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.

1
2
3
4
[root@server ~]# /etc/init.d/mysqld start
Another MySQL daemon already running with the same unix socket.
Starting mysqld:                                           [FAILED]
 

原因

非正常的关闭/停止服务,导致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,你会发现相似例如以下日志:

1
2
3
4
5
6
7
8
9
131207
21:15:47
mysqld_safe
Starting
mysqld
daemon
with
databases
from
/var/lib/mysql
/usr/libexec/mysqld:
Can't
create/write to file '/tmp/ib0h0Wt3'
(Errcode: 13)
131207
21:15:47  InnoDB: Error: unable to create temporary file; errno: 13
131207
21:15:47 [ERROR] Plugin 'InnoDB'
init function returned error.
131207
21:15:47 [ERROR] Plugin 'InnoDB'
registration as a STORAGE ENGINE failed.
131207
21:15:47 [Note] Event Scheduler: Loaded 0 events
131207
21:15:47 [Note] /usr/libexec/mysqld: ready for connections.
Version:
'5.1.71'  socket:
'/var/lib/mysql/mysql.sock'  port:
3306  Source
distribution
 

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

1
rm /var/lib/mysql/mysql.sock
1
<span
style="font-family:
monospace;">mv
/var/lib/mysql/mysql.sock
/var/lib/mysql/mysql.sock.bak</span>

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

1
rm /var/lib/mysql/mysql.sock
1
rm
/var/lib/mysql/mysql1.sock
1
rm
/var/lib/mysql/mysql22.sock

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的更多相关文章

  1. Another MySQL daemon already running with the same unix socket的解决

    问题出现: 每周一需要备份一次数据库,即从服务器MySQL导出sql文件,再导入到我机器上虚拟机的MySQL里.但是今天早上连不上,我进入控制台用#service mysqld start强行启动,报 ...

  2. MySQL“Another MySQL daemon already running with the same unix socket” 报错信息处理

    Mysql "Another Mysql daemon already running with the same unix socket" 解决办法:rm var/lib/mys ...

  3. MySQL错误Another MySQL daemon already running with the same unix socket.v

    etc/init.d/mysqld start 结果显示 Another MySQL daemon already running with the same unix socket.显示另一个MyS ...

  4. MySQL故障处理一例_Another MySQL daemon already running with the same unix socket

    MySQL故障处理一例:"Another MySQL daemon already running with the same unix socket". [root@test- ...

  5. 启动Mysql报错:Another MySQL daemon already running with the same unix socket.

    启动Mysql报错: Another MySQL daemon already running with the same unix socket. 删除如下文件即可解决 /var/lib/mysql ...

  6. Another mysql daemon already running with the same unix socket

    在国外网站发现的解决方法. 原因多个Mysql进程使用了同一个socket. 两个方法解决: 第一个是立即关机 使用命令 shutdown -h now 关机,关机后在启动,进程就停止了. 第二个直接 ...

  7. MySQL错误Another MySQL daemon already running with the same unix socket

    今天遇到RT这个问题后,导致数据库错误,然后在国外网站发现了一个解决方法,记录如下: 原因是:多个Mysql进程使用了同一个socket. 解决方法是:直接把mysql.sock文件改名即可.也可以删 ...

  8. MySQL“Another MySQL daemon already running with the same unix socket”的处理

    方法一: rm var/lib/mysql/mysql.sock service mysqld start 方法二: mv /var/lib/mysql/mysql.sock /var/lib/mys ...

  9. Another MySQL daemon already running with the same unix socket. & ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)

    mysql 断电后启动失败解决 应该是mysql.sock文件还存在. 把这个文件删掉就可以了. mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.s ...

随机推荐

  1. Office 2013 正式版 下载地址 带正版验证

    万众期待的正式版Office 2013 降临---英文版/中文简体版 英文版软件下载地址: office_professional_plus_2013_x86_dvd en_office_profes ...

  2. linux公社的大了免费在线android资料

    2011年linux数据库的android在线分享 linux公社:开源公社             本文撰写:杨凯专属频道 2011年9月12日 21:39 <目录> Android 3 ...

  3. [置顶] cocos2d-x 3.0游戏开发xcode5帅印博客教学 004.[HoldTail]主角的上下飞行跟移动

    cocos2d-x 3.0游戏开发xcode5帅印博客教学 004.[HoldTail]主角的上下飞行跟移动 写给大家的前言,在学习cocos2d-x的时候自己走了很多的弯路,也遇到了很多很多问题,不 ...

  4. jquery.form.js用法之清空form的方法

    本段代码摘取自jquery.form.js中,由于觉得该方法的使用性非常强,同时也可独立拿出来使用.该段代码言简意赅可以很好的作为学习参考. /** * Clears the form data. T ...

  5. jquery的click事件对象试解

    在写这篇文档的时候,我并没有深入的去了解jquery的事件对象是什么样的构造,不过以我以往的经验,相信能说道说道,并且可能有百分之八十是正确的,所以我并不建议这篇文档具备一定的权威性,不过可以当成饭后 ...

  6. “HTTP 错误 401.1 - 未授权:登录失败” iis配置和权限问题

    今天,将项目发布到IIS服务器上,出现此问题,本地IIS访问正常. 登录失败说明根本登录不了,谈何访问网页,所以要从两方面下手,一.账户:二.账户权限: 一.设置你网站属性的时候,目录安全性-匿名访问 ...

  7. jQuery EasyUI API 中文文档 - 菜单按钮(menubutton)

    <html> <head> <script src="jquery-easyui/jquery.min.js"></script> ...

  8. CodeForces 13E. Holes 分块处理

    正解是动态树,太难了,仅仅好分块处理水之.看了看status大概慢了一倍之多..     分块算法大体就是在找一个折衷点,使得查询和改动的时间复杂度都不算太高,均为o(sqrt(n)),所以总的时间复 ...

  9. Storyboard 经常用法总结-精华版

    1.prepareForSegue: Now we know what the destinationViewController is we can set its data properties. ...

  10. 在navigationItem中添加搜索栏

    给navigationItem中添加个搜索栏,效果和大部分程序一样.代码如下: UISearchBar *searchBar = [[UISearchBaralloc] initWithFrame:C ...