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
相关文章
相关标签/搜索