MM PP MM PP - 5 months ago 9
MySQL Question

MySql server PID not found

I have CentOS 6.4 with NGINX.

When I try to

start/stop/restart
mysql server
(/etc/init.d/mysqld restart)
I get this error:

MySQL server PID file could not be found! [FAILED]
Starting MySQL..The server quit without updating PID file ([FAILED]/mysql/mysqld.pid).


What can I do to solve this problem?

Thanks!

Answer

I got the same error on a CentOS 6.3 where I upgraded MySQL to 5.6.14 but I kept the old my.cnf file. After upgrade, MySQL did not start anymore, giving me the same error as you described.

The problem was that I had this setting in my.cnf:

table_cache=2048

According to this link table_cache renamed table_open_cache..

"Seem like in 5.5 the system variable table_cache was renamed table_open_cache.. In 5.6 mysqld fails if it finds an unknown variable this means that upgrades from versions earlier than 5.5 can have problems if table_cache is specified in my.cnf."

After I changed the above line to

table_open_cache=2048

MySQL started perfectly.

So, in the case you have MySQL 5.5+ (and maybe an older my.cnf), I suggest you to do the following:

  • remove my.cnf from /etc folder and try to start MySQL
  • if MySQL starts, the the problem is in my.cnf. Comment/uncomment all the settings one by one in order to see which is causing the problem.

Hope this helps.