1. 程式人生 > >MySQL錯誤Another MySQL daemon already running with the same unix socket.

MySQL錯誤Another MySQL daemon already running with the same unix socket.



在國外網站發現的解決方法。

原因多個Mysql程序使用了同一個socket。

兩個方法解決:

第一個是立即關機 使用命令 shutdown -h now 關機,關機後在啟動,程序就停止了。

第二個直接把mysql.sock檔案改名即可。也可以刪除,推薦改名。

然後就可以啟動mysql了。

下面是國外原文

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