我试图安装MySQL的首次在AWS上的Linux实例只要我跑第二个命令运行以下命令“错误2002(HY000):无法通过套接字'/var/lib/mysql/mysql.sock'(2)”连接到本地MySQL服务器“在aws linux(centos)上获取此文件
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):
而且我还没有把我的root密码。我该如何输入一个我没有设置的密码?
我觉得前面有mysql的这台机器还没有被完全删除安装 – sprksh
试试这个http://www.zyxware.com/articles/5098/solved-what-are-the-steps -to-reinstall-mysql-server-using-ubuntu-terminal – sprksh
隐藏文件'.mysql_secret'应该在安装它的用户的主目录下创建。这将包含您用来更改密码的默认密码。 – franklinsijo