mysqld dead but subsys locked

December 23, 2015 by Linux Guru

Filed under Database, logs, MySQL

Last modified November 30, 2016

mysqld dead but subsys locked

MySQL error:-” mysqld dead but subsys locked “

[root@s4tehno ~]# service mysqld status
mysqld dead but subsys locked. Then check processes list.

[root@s4tehno ~]# ps -aux | grep mysql
root      1877  0.0  0.0   5216  1844 ?        S    Mar15   2:55 /bin/sh /usr/bin/mysqld_safe –datadir=/var/lib/mysql –socket=/var/lib/mog-error=/var/log/mysqld.log –pid-file=/var/run/mysqld/mysqld.pid
root      4177  0.0  0.0   4048   712 pts/1    S+   14:35   0:00 grep mysql

Try to restart mysqld service using following command

[root@s4tehno ~]# service mysqld restart
rm: cannot remove `/var/lock/subsys/mysqld’: Read-only file system
rm: cannot remove `/var/lib/mysql/mysql.sock’: Read-only file system
Stopping MySQL:                                            [  OK  ]
touch: cannot touch `/var/log/mysqld.log’: Read-only file system
chown: changing ownership of `/var/log/mysqld.log’: Read-only file system
chmod: changing permissions of `/var/log/mysqld.log’: Read-only file system
chown: changing ownership of `/var/lib/mysql’: Read-only file system
chmod: changing permissions of `/var/lib/mysql’: Read-only file system

——————————————————————————————-

Try to remove mysql.sock file.

[root@s4tehno ~]# rm -rf /var/lib/mysql/mysql.sock
rm: cannot remove `/var/lib/mysql/mysql.sock’: Read-only file system

————————————————————–Restart system

[root@s4tehno ~]# ls /var/log/mysqld.log

check mysql log file if  you see “no disk space available”. then check disk space. make some free space on /var partition. then start mysql service.

Still not successfully start mysql service then run following command for assigning ownership to mysql directory

[root@s4tehno ~]#chown -R mysql:mysql /var/lib/mysql

and then restart system. Once corrected it started working with all grace

Leave a Comment