ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

重启mysql服务器后报:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

原因my.cnf配置文件加了 socket = /usr/local/mysql/mysql.sock 

注释后解决

新解决方法

mysql安装目录bin/mysql_config默认的socket路径是/tmp/mysql.sock

socket=' /tmp/mysql.sock'

将my.cnf配置文件的修改未一样的路径即可

[client]
socket = /tmp/mysql.sock
[mysql]
socket = /tmp/mysql.sock

 

posted @ 2019-03-19 17:38  江期玉  阅读(381)  评论(0编辑  收藏  举报