Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySql server PID not found

Tags:

linux

mysql

nginx

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!

like image 850
MM PP Avatar asked Jul 26 '13 07:07

MM PP


People also ask

Where is MySQL pid file?

The PID file in the MySQL data directory is gone and MySQL wont behave without it. The default MySQL data directory is /var/lib/mysql/. You can see “. err” files inside the MySQL data directory.

Is running but PID file could not be found?

The PID file could not be found error is usually caused by two things: MySQL server is not running, so no PID file was found. A mismatch between the running MySQL instance PID file location and the mysql. server command target location.


1 Answers

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.

like image 186
Ciprian Stoica Avatar answered Oct 04 '22 05:10

Ciprian Stoica