在國外網站發現的解決方法。
原因多個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
===ps:我用的第二種方法解決。卸載mysql重裝也沒搞定====