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

7 Responses to “MySQL: mysql is not running but lock exists”

  1. Pavel

    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

    Reply
  2. jonny

    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.

    Reply
  3. Joan

    not work for me

    [root@server /]# /etc/init.d/mysql restart
    ERROR! MySQL manager or server PID file could not be found!
    Starting MySQL….. ERROR! Manager of pid-file quit without updating file.

    Reply
  4. chandan

    I hate this error. I did almost everything whatever I know. Deleting the lock file, deleting the pid file. Disabling selinux rebooting system. The problem is it is not throwing any other error too only one line statement. Across the forums ppl have been able to solve it by removing the my.cnf file or by disabling the grants but I have fresh DB install.

    Reply
  5. varinder singh

    restart php-fpm service, it consume almost full system memory. check your code may be some issue with code, after restart php, nginx or http server its working fine.

    Reply

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>