要解决此错误,有两种解决方法:
1、将连接参数“host”的值由“localhost”改成“127.0.0.1”;
#vi /etc/my.cnf
[mysqld]
datadir=/storage/db/mysql
socket=/storage/db/mysql/mysql.sock
[client]
socket=/storage/db/mysql/mysql.sock
补充:
zabbix到安装界面报错" Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock"
解决办法:
#ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock #创建一个软连接
zabbix连接Mysql提示Can’t connect to local MySQL server through socket的解决方法
原文:https://www.cnblogs.com/cxq20190307/p/10755602.html