/etc/init.d/mysql: No such file or directory 和 ERROR 2002 (HY000): Can't connect to local MySQL server through socket 解决办法

更改/etc/my.cnf 

 

[client] #password = your_password port = 3306 socket = /tmp/mysql.sock # Here follows entries for some specific programs # The MySQL server [mysqld] port = 3306 socket = /tmp/mysql.sock 

 

 

 

/etc/init.d/mysqld restart 

 

 

/etc/init.d/mysqld status

 SUCCESS! MySQL running (7562)

mysql -uegilance

ERROR 1045 (28000): Access denied for user 'egilance'@'localhost' (using password: NO)

 

 

即可

 

 

你可能感兴趣的:(/etc/init.d/mysql: No such file or directory 和 ERROR 2002 (HY000): Can't connect to local MySQL server through socket 解决办法)