Tuesday, November 13, 2012

The server quit without updating PID file

With MySQL 5.6.8 RC available more and more people will start to test installs and upgrades.  This often comes up for some people so I hope this helps some.

If you seeing the error "The server quit without updating PID file" then obviously something recently changed on your environment.

So lets take it step by step:

# /etc/init.d/mysql start
Starting MySQL..The server quit without updating the PID file (/var/lib/mysql/localhost.localdomain.pid).

While yes people do say just move the my.cnf file and restart the database to by pass this error... You need to understand why. Why would moving the my.cnf allow mysql to start? Check the error logs that is how and why you will be able to fix it and get it restarted.

Issue 1:
"Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist."

So this is a result of a bad MySQL upgrade, most likely. You can start MySQL by avoiding the grants and keeping your my.cnf in place. 

# /etc/init.d/mysql start --skip-grant
Starting MySQL..                                           [  OK  ]

You also need to fix the missing grants tables.
# mysql_install_db
Installing MySQL system tables...
Filling help tables...

Issue 2:
InnoDB: Error: data file /var/lib/mysql/ibdata1 is of a different size

So your  my.cnf did change and innodb_data_file_path is now a different size than before. So you need to put back or remove the ibdata files so they can be rebuilt; the later of course will remove the data.

These are just two simple examples but if you take your time and look into the log file data you will find the reason why MySQL might not start. Moving the my.cnf is not the answer.

Additional References:
The Error Log
Monitoring MySQL – The error log
How to diagnose errors in the MySQL error log