mysql 啓動失敗

週末機房遷移,直接停了服務器了,週一來發現mysql啓動不了.信息以下mysql

sudo /etc/init.d/mysqld restart
Stopping mysqld:                                           [  OK  ]
Another MySQL daemon already running with the same unix socket.
Starting mysqld:                                           [FAILED]

在日誌裏找相關的信息也沒有找到,多是找的日誌路徑不對.sql

在百度上找了相關的資料,在一篇文章中解決了這個問題.
bash

連接爲: http://blog.csdn.net/acmilanvanbasten/article/details/17502811 服務器

如下爲文章內容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

解決問題的命令便是ide

mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak
service mysqld start
相關文章
相關標籤/搜索