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

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

解决办法:

在 /etc/my.cnf 文件后面添加下面节点: 路径和  [mysqld]  里面的的 socket 路径相同

 

[client]
socket=/opt/sys/mysql/mysqlData/mysql/mysql.sock

 

posted @ 2021-01-19 17:46  一文搞懂  阅读(2260)  评论(0编辑  收藏  举报