假设你遇到例如以下所列的不论什么问题之中的一个,本文或许能帮到你.
以上全部问题有一个共同特征:你无法使用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
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
|
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
版权声明:本文博客原创文章。博客,未经同意,不得转载。