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

后端 未结 30 2774
再見小時候
再見小時候 2020-11-22 04:23

I am having a big problem trying to connect to mysql. When I run:

/usr/local/mysql/bin/mysql start

I have the following error :

<         


        
30条回答
  •  庸人自扰
    2020-11-22 04:56

    I got the following error

    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 way

    sudo gksu gedit /etc/mysql/my.cnf
    

    modified

    #bind-address       = 127.0.0.1
    

    to

    bind-address        = localhost
    

    and restarted

    sudo /etc/init.d/mysql restart
    

    it worked

提交回复
热议问题