Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I get "MySQL is not running but lock exists"?

Tags:

mysql

locking

I am getting this error

mysql is not running but lock exist

when I am checking the status of MySQL server. I have removed the lock files using following command:

rm /var/lock/subsys/mysql

but still I am getting same error.

Can anyone provide any input on this.

like image 710
MySQL DBA Avatar asked Aug 08 '09 09:08

MySQL DBA


1 Answers

try using the unix lsof command to see which program has the lock

lsof | grep mysql

EDIT:in fact, run lsof on the lock itself

lsof /var/lock/subsys/mysql
like image 68
Charles Ma Avatar answered Sep 20 '22 14:09

Charles Ma