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

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

 原因是/var/lib/mysql 的访问权限问题。


shell> chown -R mysql:mysql /var/lib/mysql

接着启动服务器

shell> /etc/init.d/mysql start

服务器正常启动后察看 /var/lib/mysql 自动生成mysql.sock文件。

你可能感兴趣的:(mysql,socket,server,shell,服务器)