If you ever come across a “MySQL (Percona Server) PID file could not be found” message when trying to restart, or stop your MySQL server there is an easy fix. Simply check the current running processes and get the PID of the MySQL process, then echo it into the pid file.

Example:


$ -> ps -auxfw | ack mysql

mysql    26519  0.1 23.2 755928 101344 pts/1   Sl   05:51   0:00  \_ /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysql/error.log --pid-file=/var/lib/mysql/myhost.pid --socket=/var/lib/mysql/mysql.sock --port=3306

$ -> echo 26519 > /var/lib/mysql/myhost.pid

$ -> /etc/init.d/mysql stop

/etc/init.d/mysql stopShutting down MySQL (Percona Server)....                   [  OK  ]

Now you should be able to start your MySQL server like normal.