1. 程式人生 > >Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

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

can mys 解決 serve .so error erro connect oot

[root@obp-db-001 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' (2)