Another MySQL daemon already running with the same unix socket

话说在搭建LAMP环境的时候,安装MySQL的过程是出奇的顺利。
谁知第二天打开CentOS自检的时候发现MySQL竟然启动失败了!!
QAQ…是什么情况?先重启一下MYSQL试试:


#service mysqld restart


然后就出现了如标题那样的Error:


Another MySQL daemon already running with the same unix socket.

这错误提示信息貌似是说已经有另一个MySQL实例在相同的unix socket上运行了…
于是请教度娘与谷歌娘,发现如下文章:http://hi.baidu.com/tf8615/item/75d7a6b0ac8be042ba0e1282

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

问题终于解决。(^o^)/~
究其原因,是因为非正常关机所导致滴,在断开电源时,MySQL进程并没有被正常结束,所以产生了“历史遗留问题”!
解决方法其实也很简单
删除旧的mysql.sock文件,然后重新启动MySQL即可。

#rm /var/lib/mysql/mysql.sock

#service mysqld start



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值