mysql已死,但子系统已锁定 [英] mysql is dead but subsys locked
问题描述
我正在 Linux(RHEL 5.0)上首次使用PHP-mysql
当我尝试使用mysqli_connect从我的PHP脚本连接到MySQL时.
它显示以下错误:
I am using PHP-mysql on Linux (RHEL 5.0) For First Time
When I tried to connect to MySQL from my PHP Script using mysqli_connect.
It Displayed The Following Error:
Can't connect to local MySQL server through socket '/var/mysql/mysql.sock'(2)
After googling for hour I found solution to this as stated here.
当我遵循这种方法并发出命令时:
When I followed that approach and issued command:
service mysqld status
以root用户身份
我得到了:mysql is dead but subsys locked
有人知道如何解决这个问题并导致此错误吗?
as a root user
I got : mysql is dead but subsys locked
Any one know how to solve this and cause of this error ?
也
- 重新启动
- 开始
- 并停止MySQL
预先感谢.
Thanks in advance.
推荐答案
在尝试将a升级为大软件包后,我的OTRS服务器出现了此问题.
I had this problem with my OTRS server after I tried to update a to large package.
解决方案是:
为安全起见复制:
cp /var/lock/subsys/mysqld /root/mysqld
比删除它
rm /var/lock/subsys/mysqld
关闭所有依赖mysql的服务
than close all services that depends on mysql:
service httpd stop
service otrs stop
之后:
service mysqld restart
service httpd restart
service otrs restart
系统是CentOS 6.x
System is CentOS 6.x
这篇关于mysql已死,但子系统已锁定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!