Another MySQL daemon already running with the same unix socket

来源:互联网 发布:江西丰城网络问政 编辑:程序博客网 时间:2024/05/22 03:43

转自:http://frozensky.sinaapp.com/mysql-error-sameunixsocket/

话说Avalon在搭建环境的时候,安装MySQL的过程是出奇的顺利,数据库建好后某雪就呼呼睡大觉去了。(~ o ~)~zZ

谁知早上起床打开CentOS自检的时候发现MySQL竟然启动失败了!!

QAQ…是什么情况?先重启一下MYSQL试试:

#service mysqld restart

然后就出现了如标题那样的Error:

Another MySQL daemon already running with the same unix socket.     

这错误提示信息貌似是说已经有另一个MySQL实例在相同的unix socket上运行了… (完全不懂 T.T)

于是请教度娘与谷歌娘,发现如下文章:http://hi.baidu.com/tf8615/item/75d7a6b0ac8be042ba0e1282

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

 

问题终于解决。(^o^)/~

究其原因,是因为某雪的非正常关机所导致滴,在断开电源时,MySQL进程并没有被正常结束,所以产生了“历史遗留问题”!

解决方法其实也很简单

删除旧的mysql.sock文件,然后重新启动MySQL即可。

#rm /var/lib/mysql/mysql.sock

#service mysqld start

0 0