码迷,mamicode.com
首页 > 数据库 > 详细

Unable to start MySQL service. Another MySQL daemon is already running with the same UNIX socket

时间:2014-12-22 16:12:47      阅读:265      评论:0      收藏:0      [点我收藏+]

标签:mysql   sock   启动失败   unix   

Unable to start MySQL service. Another MySQL daemon is already running with the same UNIX socket

 

特征

如果你遇到如下所列的任何问题之一,本文也许能帮到你.

  • MySQL starts/stops properly when started/stopped with the mysqld service restart, but MySQL does not start when a server is rebooted.
  • After upgrading MySQL, binaries mysqld will not start at all.
  • After relocating the MySQL datadir or changing the default port, MySQL does not start.

以上所有问题有一个共同特征:你无法使用service mysqld restart/start或其他方式启动mysql.

原因

非正常的关闭/停止服务,导致mysqld的socket没有被移除. 该非正常的方式比较常见于:系统断电重启.

解决办法

There are several common cases when the socket file is not removed. Please check the below use cases and apply the appropriate resolution.

1. 查看/var/log/mysqld.log,你会发现类似如下日志:

网上百度到该问题的解决办法都是:

笔者试了很多此,发现还是启动不成功.细看log,文本末尾写着的不只/var/lib/mysql/mysql.sock,还有/var/lib/mysql/mysql1.sock,/var/lib/mysql/mysql22.sock.而我的文件夹目录中也正好存在这些文件.于是猜想, mysql异常关闭之后,不单只产生myql.sock,还有其他sock文件,我将这三个sock文件都重命名后,myql便正常启动了.

2. 总结

 mysql异常关闭时,产生的sock文件可能存在多个,要将这些sock文件都清除,mysql才能正常启动.

 

原文链接:Unable to start MySQL service. Another MySQL daemon is already running with the same UNIX socket.

参考文献:http://kb.sp.parallels.com/en/119334

Unable to start MySQL service. Another MySQL daemon is already running with the same UNIX socket

标签:mysql   sock   启动失败   unix   

原文地址:http://blog.csdn.net/vicklin/article/details/42081041

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!