gpt4 book ai didi

mysql - 新的 SQL 安装已经将我锁定为 root

转载 作者:行者123 更新时间:2023-11-29 21:39:57 24 4
gpt4 key购买 nike

我对此有点疯狂,但这就是正在发生的事情。

我正在安装 mysql 和 mysql 服务器,但运行 mysql_secure_installation 并且它已经将我锁定在 root 之外。

这是我所经历的全部事情。我不知道默认密码是什么,但每个人都一直说尝试“root”或直接按 Enter 键(根本没有密码)。我到底是怎么从一开始就被锁在外面的?

    [root@Gretchen ~]# dnf install mysql mysql-server
Last metadata expiration check performed 1:52:35 ago on Tue Jan 5 10:07:03 2016.
Dependencies resolved.
=============================================================================================================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================================================================================================
Installing:
mecab x86_64 0.996-1.fc23.3 fedora 393 k
mecab-ipadic x86_64 2.7.0.20070801-11.fc23.1 fedora 11 M
mysql-community-client x86_64 5.7.10-1.fc23 mysql57-community 25 M
mysql-community-common x86_64 5.7.10-1.fc23 mysql57-community 274 k
mysql-community-libs x86_64 5.7.10-1.fc23 mysql57-community 2.2 M
mysql-community-server x86_64 5.7.10-1.fc23 mysql57-community 105 M

Transaction Summary
=============================================================================================================================================================================================================================================
Install 6 Packages

Total download size: 143 M
Installed size: 670 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): mysql-community-common-5.7.10-1.fc23.x86_64.rpm 629 kB/s | 274 kB 00:00
(2/6): mysql-community-libs-5.7.10-1.fc23.x86_64.rpm 609 kB/s | 2.2 MB 00:03
(3/6): mecab-0.996-1.fc23.3.x86_64.rpm 588 kB/s | 393 kB 00:00
(4/6): mecab-ipadic-2.7.0.20070801-11.fc23.1.x86_64.rpm 662 kB/s | 11 MB 00:16
(5/6): mysql-community-client-5.7.10-1.fc23.x86_64.rpm 1.0 MB/s | 25 MB 00:23
(6/6): mysql-community-server-5.7.10-1.fc23.x86_64.rpm 1.9 MB/s | 105 MB 00:55
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 2.5 MB/s | 143 MB 00:56
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Installing : mecab-0.996-1.fc23.3.x86_64 1/6
Installing : mysql-community-common-5.7.10-1.fc23.x86_64 2/6
Installing : mysql-community-libs-5.7.10-1.fc23.x86_64 3/6
Installing : mysql-community-client-5.7.10-1.fc23.x86_64 4/6
Installing : mecab-ipadic-2.7.0.20070801-11.fc23.1.x86_64 5/6
Installing : mysql-community-server-5.7.10-1.fc23.x86_64 6/6
Verifying : mysql-community-client-5.7.10-1.fc23.x86_64 1/6
Verifying : mysql-community-libs-5.7.10-1.fc23.x86_64 2/6
Verifying : mysql-community-common-5.7.10-1.fc23.x86_64 3/6
Verifying : mysql-community-server-5.7.10-1.fc23.x86_64 4/6
Verifying : mecab-0.996-1.fc23.3.x86_64 5/6
Verifying : mecab-ipadic-2.7.0.20070801-11.fc23.1.x86_64 6/6

Installed:
mecab.x86_64 0.996-1.fc23.3 mecab-ipadic.x86_64 2.7.0.20070801-11.fc23.1 mysql-community-client.x86_64 5.7.10-1.fc23 mysql-community-common.x86_64 5.7.10-1.fc23 mysql-community-libs.x86_64 5.7.10-1.fc23
mysql-community-server.x86_64 5.7.10-1.fc23

Complete!
[root@Gretchen ~]#
[root@Gretchen ~]# service mysqld start
Redirecting to /bin/systemctl start mysqld.service
[root@Gretchen ~]#
[root@Gretchen ~]#
[root@Gretchen ~]# cd /usr/bin
[root@Gretchen bin]# mysql_secure_installation

Securing the MySQL server deployment.

Enter password for user root:
Error: Access denied for user 'root'@'localhost' (using password: NO)
[root@Gretchen bin]# mysql_secure_installation

Securing the MySQL server deployment.

Enter password for user root:
Error: Access denied for user 'root'@'localhost' (using password: YES)
[root@Gretchen bin]#

当然,如果我卸载并重新安装,这种情况仍然会发生。恐怕我可能还安装了其他一些我应该卸载的东西,但我不确定。

我没有兴趣保留任何数据库或用户或任何东西。我只想让 SQL 从头开始​​,而不必重做整个服务器。

最佳答案

通常mysql存储您的初始root密码将存储在/root/.mysql_secret中。检查一下。

关于mysql - 新的 SQL 安装已经将我锁定为 root,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34617630/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com