问题:启动mysql 报错:

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

处理方法:修改/etc/my.conf:

[mysqld]
socket=/var/lib/mysql/mysql.sock  以前是socket=/tmp/mysql.sock


[client]
socket=/var/lib/mysql/mysql.sock  以前是socket=/tmp/mysql.sock


修改后重新启动mysql服务

service mysqld restart


成功解决问题