[How To] Fix "MySQL is running but PID file could not be found" error

MySQL is one of the widely used database software in the application world. Many times, one has to work on the MySQL services and restart the services for the changes made to take effect or etc...

While restarting MySQL service, you may get a error as

MySQL is running but PID file could not be found

This might be due to issues with disk space, disk inode usage or innodb corruption which may lead to the error.

In my case, the issue was with the pid file and solution was:

1) SSH server as a root user

2) Create directory /var/run/mysql

mkdir /var/run/mysql

3) Create  a file with name as mysqld.pid

touch mysqld.pid

4) Change its ownership and group to  mysql:mysql

chown mysql:mysql mysqld.pid

5) Restart MySQL service and you will see no more errors

If any feedback, queries are always welcome!


Share on FacebookShare on Google+Tweet about this on TwitterShare on StumbleUponShare on LinkedInShare on TumblrDigg thisPin on PinterestShare on RedditEmail this to someonePrint this page
MySQL is one of the widely used database software in the application world. Many times, one has to work on the MySQL services and restart the services for the changes made to take effect or etc... While restarting MySQL service, you may get a error as MySQL is running but PID file could not be ...

Review Overview

User Rating: 4.95 ( 2 votes)
0

About Abhijit Sandhan

Abhijit Sandhan
Loves Linux, Blogging, Traveling, Hiking and sharing the knowledge!

2 comments

  1. I get the error "mysqld dead but pid file exists" Would you know why I see this error ?

    • Abhijit Sandhan

      It seems that the process is still running. Check the process id using command
      ps aufx | grep mysql*
      and kill that process using kill command
      kill -9 PID
      Try restarting MySQL service

Leave a Reply

Your email address will not be published. Required fields are marked *

*

CAPTCHA Image

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>