“MySQL is running but PID file could not be found” error

Sometimes while restarting MySQL service, you may get a error as:

MySQL is running but PID file could not be found

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

1) SSH into your 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 no more see this error.