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

突然发现mysql数据库出问题了
1.问题如图,连接不上了?
这里写图片描述
2.使用 service mysqld status 查看状况发现服务不在,
service mysqld start 服务无法启动,报错,换个启动方法,发现如题的错误。
这里写图片描述
3.怎么处理?
MySQL错误处理:Another MySQL daemon already running with the same unix socket._第1张图片
4.原因多个Mysql进程使用了同一个socket。
两个方法解决:
第一个是立即关机 使用命令 shutdown -h now 关机,关机后在启动,进程就停止了。
第二个直接把mysql.sock文件改名即可。也可以删除,推荐改名。
然后就可以启动mysql了。
MySQL错误处理:Another MySQL daemon already running with the same unix socket._第2张图片
看看下面的内容:

To prevent the problem from occurring, you must perform a graceful shutdown of the server from the command line rather than powering off the server.

# shutdown -h now


This will stop the running services before powering down the machine.

Based on Centos, an additional method for getting it back up again when you run into this problem is to move mysql.sock:

# mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak

# service mysqld start
Restarting the service creates a new entry called mqsql.sock

问题解决!

你可能感兴趣的:(Mysql)