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

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

时间: 2024-10-11 10:31:14

Unable to start MySQL service. Another MySQL daemon is already running with the same UNIX socket的相关文章

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

MySQL故障处理一例:"Another MySQL daemon already running with the same unix socket". [[email protected]121 sbin]# service mysqld status mysqld 已停 [[email protected]-121 sbin]# service mysqld start Another MySQL daemon already running with the same unix

Another MySQL daemon already running with the same unix socket.

问题描述: 查看MySQL进程的状态: [[email protected] lib]# service mysqld statusmysqld is stopped 发现是关闭的,但是启动MySQL却报错 [[email protected] lib]# service mysqld startAnother MySQL daemon already running with the same unix socket. 解决方法:将mysql.sock备份一下,然后重新启动 mv /var/l

MySQL“Another MySQL daemon already running with the same unix socket”的处理和思考

今天早上起来发现mysql登录不上了,service mysqld restart先包正确再报失败,报的错误就是Another MySQL daemon already running with the same unix socket. 太闹心了:大早上的小样儿就给我添堵,看大爷怎么收拾你. 直接干死这个:rm var/lib/mysql/mysql.sock 然后起服务:service mysqld start 我去!竟然不行!上头了! 重头来:shutdown -h now 进来之后:mv

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

启动mysql 报错: [[email protected] ~]# /etc/init.d/mysqld start Socket file /tmp/mysql_slave.sock exists. Is another MySQL daemon already running with the same unix socket? 原因多个Mysql进程使用了同一个socket. 两个方法解决: 第一个是立即关机 使用命令 shutdown -h now 关机,关机后在启动,进程就停止了.

Mysql启动时提示:Another MySQL daemon already running with the same unix socket.

场景:vmvare虚拟机.centos7.mysql5.7 解决: mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak 参考: http://stackoverflow.com/questions/20407292/centos-another-mysql-daemon-already-running-with-the-same-unix-socket

Linux下重新安装MySql后出现&#39;MySQL Daemon failed to start‘解决方法

Linux下重新安装MySql后出现'MySQL Daemon failed to start‘解决方法 近日在搭建lepus环境时,发现安装了xampp后,mysql启动不了. 运行service mysqld start或者/etc/init.d/mysqld start,出现: 运行mysql -uroot -p123456,出现: 后面在网上找到一种方法解决了此问题 rm -fr /var/lib/mysql/* rm /var/lock/subsys/mysqld killall my

centos7 mysql 启动mysqld.service - SYSV: MySQL database server错误

1.启动命令 systemctl start mysqld.service 或者 /etc/init.d/mysqld start   结果同样的错误 2.错误是: Job for mysqld.service failed. See 'systemctl status mysqld.service' and 'journalctl -xn' for details. 3.按照提示输入命令 systemctl status mysqld.service 或者 journalctl -xn 命令后

基于corosync和pacemaker实现HA mysql service

corosync基础介绍 corosync AIS: Application Interface Standard,应用程序接口规范 SA Forum:服务可用性论坛,OpenAIS即是此论坛开发 OpenAIS 提供了一种集群模式,包含集群框架.集群成员管理.通信方式.集群监测等,但没有提供集群资源管理功能: 常用组件包括:AMF,CLM,CPKT,EVT等接口,分支不同,包含的组件略有区别: 目前的三大主要分支包括:picacho,whitetank,wilson:OpenAIS在由whit

corosync结合drbd实现HA mysql service

本文将介绍如何利用corosync和pacemaker结合drbd,构建一个高可用的mysql集群服务.在正式介绍之前,我们要先对drbd有一个基本的了解:什么是drbd.为何要使用drbd构建mysql.其优势何在? DRBD 分布式磁盘块设备 跨主机的块设备镜像系统,基于网络实现数据镜像,是工作于内核的软件 用户空间管理工具:drbdadm, drbdsetup, drbdmeta 工作特性:实时.透明.同步或异步 drbd工作原理图 用户空间的应用程序存储数据时本来是直接向内核发起系统调用