ERROR 2002 (HY000): Can't connect to local MySQL錯誤

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

最後發如今my.cnf配置文件中,有一行綁定IP的沒有修改,仍是原來的IP,把它修改爲當前mysql服務器的IP,重啓服務(sudo service mysql restart),便可,用迴環地址(127.0.0.1)和localhost,遠程的客戶端便訪問不到,不知爲何。好比個人是私網地址192.168.31.245,直接bind-address = 192.168.31.245sql


############################################################################服務器

這個並很差使?
socket

http://stackoverflow.com/questions/5376427/cant-connect-to-local-mysql-server-through-socket-var-mysql-mysql-sock-38
rest

34        down votecode

I got the following errorserver

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

Tried several ways and finally solved it through the following wayget

sudo gksu gedit /etc/mysql/my.cnf

modifiedit

#bind-address       = 127.0.0.1

toio

bind-address        = localhost

and restarted

sudo /etc/init.d/mysql restart

it worked

相關文章
相關標籤/搜索