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

后端 未结 30 2710
再見小時候
再見小時候 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条回答
  •  萌比男神i
    2020-11-22 04:41

    To prevent the problem from occurring, you must perform a graceful shutdown of the server from the command line rather than powering off the server.

    shutdown -h now
    

    This will stop the running services before powering down the machine.

    Based on Centos, an additional method for getting it back up again when you run into this problem is to move mysql.sock:

    mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak
    
    service mysqld start
    

    Restarting the service creates a new entry called mqsql.sock

提交回复
热议问题