Can't connect to local MySQL server through socket 问题解决办法

参考 https://tableplus.com/blog/2018/08/solved-cant-connect-to-local-mysql-server-through-socket.html

错误消息为:

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

症状,是msyql 命令可以通过root@127.0.0.1登录到msyql服务器,但是无法通过root@localhost登录

解决办法,修改msyql的配置文件,/etc/my.cnf

[mysqld]

socket=/var/lib/mysql/mysql.sock 

[client]

socket=/var/lib/mysql/mysql.sock

重启msyqld服务。

 

Can't connect to local MySQL server through socket 问题解决办法

上一篇:MySQL修改某一列的前几个字符


下一篇:Oracle 11G 密码180天(默认值)过期后的修改方法