How to Fix “MySQL Is Running But PID File Could Not Be Found” Error?

Fix “MySQL Server PID File Could Not Be Found” Error

Hello everyone, I have one problem of my MySQL database. I am getting an error in the database stated “MySQL is running but PID file could not be found” and I have tried several process to fix it. Even I have tried to shutdown mysqladmin which also does not work. Finally I have to kill the process ID and I was lucky enough that my database is safe and it did not cause any issue. But still I am confused what to do and not getting any option to solve it. What to do, can anyone help me?

Well MySQL is one of the useful database which is used by many organization and it is a database software in the application world. It is used for many purpose and sometimes users has to work with its services and then restart the services for the changes which is made to see the effect. But while starting MySQL service, an error may occur which can disturb the entire database. The error states:

MySQL is running but PID file could not be found

This issue can be due to several unwanted things and even due to disk space, innodb corruption or may be disk inode.

Fix “MySQL Server PID File Could Not Be Found” Error

Here the issue is with PID file and solution is mentioned:

SSH server as a root user

Then create a directory /var/run/mysql

mkdir /var/run/mysql

Now create a file named as


Then change its ownership and group to mysql:mysql

chown mysql:mysql

At last restart the MySQL service and no errors will be seen.

If you are not satisfied with this process then you have to completely kill the process Id. For that you have to follow the steps provided:

First check whether /tmp partition is full. This happens when MySQL cannot write the /tmp partition to create a lock file.

df -h

Even there is a possibility that the /tmp partition is cleared and MySQL server is looking for PID file there. Therefore just create a new PID file and again restart the server.

touch /tmp/mysql.sock
service mysqld restart

By doing this the status is checked, even sometimes you can get an error message like:

$ service mysqld status
ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists

Well this may be an instance, just remove the lock file and then restart the server.

rm /var/lock/subsys/mysql
service mysqld restart

When this does not work then you have to kill the current MySQL process from server by below mentioned steps:

ps -aufx | grep mysql

With process ID you can get all process of MySQL. You need to kill PID for MySQL by the following command

kill -9 PID1 PD2…

At last restart MySQL service

service mysql restart

The above steps mentioned are the ways to repair error! MySQL is not running, but PID file exists and this should be followed properly.

Automatic Way to Repair “MySQL Is Running But PID File Could Not Be Found”

After trying the above mentioned steps if still you are facing the same issue then you need to use third party tool like MySQL file Repair Tool which is one of the best tool for repairing MySQL database. It completely works to fix any type of error in MySQL and recovers the entire database.

This software can also save the retrieved information in Transact-SQL script which is fit for quick database recreation. And also it recovers table structure and data. It supports MySQL versions like 5.x, 4.x, 3.x, 2.x and 1.x and available for all modern platforms that includes windows 95/98/2000/XP/2003 server.

It has the ability to repair password protected SQL files smoothly. And most importantly it is very user friendly. So, you need to download this excellent program and follow its easy steps to fix error! MySQL server PID file could not be found! with ease.

Steps to repair corrupted MySQL table

Step 1: Start with Stellar Phoenix Database Repair for MySQL . Software and you can see the main interface as shown below.1

Step 2: Click on ‘Select’ button & then select ‘Repair corrupt database which is stored at default location of MySQL’ option to select your database from default location and then click.2

Step 3: The left pane shows the preview of database and its component in a tree like structure after completing scanning process.3

Step 4: After previewing your database, to start repair process click ‘Repair’ button in file menu on the main user interface. Stellar Phoenix Database Repair for MySQL dialog box appears. Click Yes.


Step 5: After successful completion of the process, a message box is displayed as ‘repair process finished successfully’. Click ‘OK’ to close the message box.5

Step 6: If you want to select the database manually then select ‘Manual selection of database to repair’ option & then click browse. Browse the folder dialog box opens. Select the folder that contains database and click ‘OK’.

Time To Conclude

I Hope, the aforementioned methods will help you to resolve ‘MySQL is running but PID file could not be found’ error and recovers table structure & data with ease. but if you want instant resolution to fix this error then you can try MySQL Repair Tool. This program will definitely allow you to repair your MySQL database and get back all the database in a hassle free manner.

Therefore, all the very best to you………