首页 > 代码库 > Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

[root@test]# /usr/local/mysql/bin/mysql -uroot
ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘ (2)
[root@test]# ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

再次链接就好了。