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

Posted 园芳宝贝

tags:

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

mysql -uroot -p

解决:

建立软链接:

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

即可。

 

参考:https://www.cnblogs.com/Lam7/p/6090975.html

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

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' 。安装后出错

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

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

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

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

尝试了一切仍然得到 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (