Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

Posted jipinglong

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' 相关的知识,希望对你有一定的参考价值。

[[email protected] etc]# mysql -uroot
ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘ (2)

解决办法:

ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock


以上是关于Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' 的主要内容,如果未能解决你的问题,请参考以下文章

MySQL Can't connect to MySQL server on 'localhost' (10061)

Jenkins: Can't connect to Docker daemon解决办法

MySQL错误2003:Can't connect to MySQL server (10060)

Can't connect to MySQL server on 'localhost'(10061)解决方法

MySQL:Can't connect to mysql server 10038

解决Can't connect to MySQL server on 'localhost' (10048)