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. Wayland中的跨进程过程调用浅析

    原文地址:http://blog.csdn.net/jinzhuojun/article/details/40264449 Wayland协议主要提供了Client端应用与Server端Composi ...

  2. 14.4.3.4 Configuring InnoDB Buffer Pool Prefetching (Read-Ahead) 配置InnoDB Buffer pool 预读

    14.4.3.4 Configuring InnoDB Buffer Pool Prefetching (Read-Ahead) 配置InnoDB Buffer pool 预读 一个预读请求 是一个I ...

  3. VC调试篇

    难怪很多前辈说调试是一个程序员最基本的技能,其重要性甚至超过学习一门语言.不会调试的程序员就意味着他即使会一门语言,却不能编制出任何好的软件. 我以前接触的程序大多是有比较成形的思路和方法,调试起来出 ...

  4. hibernate学习(一)

    一.准备工作:导入jar包 1.hibernate的jar包 位置: hibernate-release-5.0.2.Final\hibernate-release-5.0.2.Final\lib\r ...

  5. Win8下在Vmware11中安装使用苹果系统OS X 10.10

    原文:Win8下在Vmware11中安装使用苹果系统OS X 10.10   近来因为需要做 iOS 的项目,所以需要多花一些时间看看敲敲代码.因为自己手头上并没有 Mac(过年为了闲的时候能玩玩游戏 ...

  6. ThinkPHP配置项(六)

    原文:ThinkPHP配置项(六) 配置项--这只是部分的配置,后期会随时跟大家更新分享 1:修改URL分隔符 目录:thinkphp\Home\Conf\config.php打开配置文件代码中加上: ...

  7. Android中的跨进程通信方法实例及特点分析(二):ContentProvider

    1.ContentProvider简单介绍 在Android中有些数据(如通讯录.音频.视频文件等)是要供非常多应用程序使用的.为了更好地对外提供数据.Android系统给我们提供了Content P ...

  8. graph driver-device mapper-02driver基本操作

    // 清除thin pool 1.1 func (d *Driver) Cleanup() error { // 停止thin pool err := d.DeviceSet.Shutdown() r ...

  9. Unity学习笔记(二)——第一个Unity项目Hello Unity

    保留版权,转载请注明出处:http://blog.csdn.net/panjunbiao/article/details/9318811 在这一篇文章里,参照宣雨松的<Unity 3D游戏开发& ...

  10. hdu2444(判二分图+最大匹配)

    传送门:The Accomodation of Students 题意:有n个学生,m对相互认识的,问能否分成两队,使得每对中没有相互认识的,如果可以求最大匹配,否则输出No. 分析:判断二分图用染色 ...