Another MySQL daemon already running with the same unix socket

话说在搭建LAMP环境的时候,安装MySQL的过程是出奇的顺利。
谁知第二天打开CentOS自检的时候发现MySQL竟然启动失败了!!
QAQ…是什么情况?先重启一下MYSQL试试:


#service mysqld restart


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


Another MySQL daemon already running with the same unix socket.

这错误提示信息貌似是说已经有另一个MySQL实例在相同的unix socket上运行了…
于是请教度娘与谷歌娘,发现如下文章: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



©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页