MySQL: mysql is not running but lock exists

A MySQL crash on Red Hat system resulted with:

/etc/init.d/mysql status

coming back with:

mysql is not running but lock exists

Solved by removing the lock file:

rm /var/lock/subsys/mysql

If this happens again it may also be necessary to remove the pid file from /var/lib/mysql

3 Comments to “MySQL: mysql is not running but lock exists”

  • Excellent!!!
    thanks!

  • it is not working
    mysql.sock not found
    mysql.pid not found
    /var/lock/subsys/mysql not found

    when i start mysql
    Starting MySQL..Manager of pid-file quit without updating

    mysql status
    MySQL is not running, but lock exists
    mysql.sock not found
    mysql.pid not found
    /var/lock/subsys/mysql exists

    why? help me please

  • Maybe check /etc/my.cnf to see where MySQL wants to put the pid file and socket file.
    You could also try “locate mysql.sock” and “locate mysql.pid” to see if you can find them.
    “ls -al /var/lock/subsys” to check if the lock does really exist.
    “ps -ef | grep mysql” to see if there are any other mysql processes running.
    Make sure that the pid file, lock file and socket do not exist before starting with:
    /etc/init.d/mysqld start
    or
    /etc/init.d/mysqld restart
    Hopefully some of this will help you Pavel.

Post comment