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

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

先檢視 /etc/rc.d/init.d/mysqld status 看看m y s q l 是否已經啟動. 另外看看是不是許可權問題. ———————————————————————————— [[email protected] beinan]#chown -R mysql:mysql /var/lib/mysql [[email protected] beinan]# /etc/init.d/mysqld start 啟動 MySQL: [ 確定 ] [[email protected] lib]# mysqladmin -uroot password ‘123456’ [[email protected] lib]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or /g. Your MySQL connection id is 3 to server version: 4.1.11 Type ‘help;’ or ‘/h’ for help. Type ‘/c’ to clear the buffe