【发布时间】:2017-07-03 15:57:05
【问题描述】:
我第一次尝试在运行以下命令的 aws linux 实例上安装 mysql
sudo yum install mysql-server
sudo mysql_secure_installation
当我运行第二个命令时,我得到了
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Enter current password for root (enter for none):
我什至没有设置我的根密码。我应该如何输入我一开始没有设置的密码?
【问题讨论】:
-
我认为之前这台机器上安装了mysql,但没有完全删除
-
一个隐藏文件
.mysql_secret将在安装它的用户的主目录下创建。这将包含您用于更改密码的默认密码。 -
@sprksh 已经这样做了。即使重新安装“输入当前密码”后仍然得到完全相同的东西
标签: mysql linux amazon-web-services