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

在/etc/my.cnf文件中添加如下内容,并重启mysqls服务

[mysqld]
datadir=/storage/db/mysql
socket=/storage/db/mysql/mysql.sock

[mysql]
socket=/storage/db/mysql/mysql.sock

[client]
socket=/storage/db/mysql/mysql.sock

[mysqldump]
socket=/storage/db/mysql/mysql.sock

[mysqladmin]

socket=/storage/db/mysql/mysql.sock


socket的值要改为my.cnf中原来的socket的值



版权声明:本文为sheng_xinjun原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。