ERROR! MySQL server PID file could not be found!
First of all, always check if the /tmp partition is full. This can happen when MySQL can’t write to the /tmp partition to create a lock file.
$ df -h
Also, this may be because, somehow the /tmp partition has been cleared and the MySQL server is looking for the PID file there. So easy-peasy just create a new pid file and restart the server.
$ touch /tmp/mysql.sock $ service mysqld restartIt can also help to check the status, sometimes it helps. For example sometimes you can get an error like this :
$ service mysqld status ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) existsWell, it’s kind of obvious, just remove the lock file and restart the server.
$ rm /var/lock/subsys/mysql $ service mysqld restartIf none of these help, and you’re getting an error like this:
$ service mysqld restart ERROR! MySQL server PID file could not be found! Starting MySQL. ERROR! The server quit without updating PID file (/var/lib/mysql/mydomain.com.pid).Then there might be a more complicated problem. Check the log file at /var/lib/mysql/mydomain.com.err
$ tail /var/lib/mysql/mydomain.com.err 120602 16:54:09 mysqld_safe mysqld from pid file /var/lib/mysql/mydomain.com.pid endedThis line tells us that we have a compatibility problem with some of our tables and mysql fails to start in safe mode. Now let’s change the way mysql starts to work around this situtation.
$ { echo “mysql_enable=\”YES\”"; echo “mysql_args=\”–skip-grant-tables –skip-networking\”"; } >> /etc/init/rc.confTime to restart
$ /etc/init.d/mysqld restartYou should a get successfull restart. Now try and upgrade the server.
$ mysql_upgradeIf it says you have the latest version, still force it.
$ mysql_upgrade –forceIt will check every database if it’s ok. After that, we can return things to normal, comment out the last line we’ve added to /etc/init/rc.conf
$ sed -i ‘/mysql_args/s/^/#/’ /etc/init/rc.conf $ service mysqld restartHope this helps.