Mani's Blog

October 12, 2011

MySQL: ERROR! MySQL server PID file could not be found!

Filed under: MySQL — mani @ 3:24 am

I ran into error ERROR! MySQL server PID file could not be found!,  MyQL is complaining that PID file could not be found while stopping the MySQL.  I tried to shutdown mysqladmin, that didn’t work either.  Finally I had to kill the process ID as below.  Luckily the traffic was going through Slave and recovery didn’t cause any issue.

root@@my-host001:/home/mani#/etc/init.d/mysql stop
ERROR! MySQL server PID file could not be found!

root@@my-host001:/home/mani#/etc/init.d/mysql stop
ERROR! MySQL server PID file could not be found!

root@@my-host001:/home/mani#ps -ef | grep mysql
root      1981     1  0 Jul26 ?        00:00:00 /local/mysql/support/ent/agent/libexec/mysql-monitor-agent –defaults-file=/local/mysql/support/ent/agent/etc/mysql-monitor-agent.ini –daemon –pid-file=/local/mysql/support/ent/agent/mysql-monitor-agent.pid
root      1982  1981  0 Jul26 ?        01:21:23 /local/mysql/support/ent/agent/libexec/mysql-monitor-agent –defaults-file=/local/mysql/support/ent/agent/etc/mysql-monitor-agent.ini –daemon –pid-file=/local/mysql/support/ent/agent/mysql-monitor-agent.pid
root     18464 18337  0 17:36 pts/7    00:00:00 mysql -uroot -p
root     18466 18339  0 17:36 pts/9    00:00:00 mysql -uroot -p
root     18467 18338  0 17:36 pts/8    00:00:00 mysql -uroot -p
root     18468 18342  0 17:36 pts/10   00:00:00 mysql -uroot -p
root     21016 18353  0 21:31 pts/11   00:00:00 grep mysql
root     30363     1  0 Jul26 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe –datadir=/local/mysql/data –pid-file=/local/mysql/data/mysqld.pid
mysql    31499 30363 17 Jul26 ?        10-22:08:25 /usr/sbin/mysqld –basedir=/usr –datadir=/local/mysql/data –plugin-dir=/usr/lib64/mysql/plugin –user=mysql –log-error=/var/log/mysqld/mysqld.err –open-files-limit=65535 –pid-file=/local/mysql/data/mysqld.pid –socket=/tmp/mysql.sock –port=3306

root@@my-host001:/home/mani#ll /tmp
total 20
drwxrwxrwt  3 root  root  4096 Sep 27 21:28 .
drwxr-xr-x 25 root  root  4096 Dec  3  2010 ..
drwxrwxrwt  2 root  root  4096 Dec  3  2010 .ICE-unix
srwxrwxrwx  1 mysql mysql    0 Jul 26 06:46 mysql.sock
root@@my-host001:/home/mani#mysqladmin -uroot -p -S /tmp/mysql.sock shutdown
Enter password:
root@@my-host001:/home/mani#ps -ef | grep mysql
root      1981     1  0 Jul26 ?        00:00:00 /local/mysql/support/ent/agent/libexec/mysql-monitor-agent –defaults-file=/local/mysql/support/ent/agent/etc/mysql-monitor-agent.ini –daemon –pid-file=/local/mysql/support/ent/agent/mysql-monitor-agent.pid
root      1982  1981  0 Jul26 ?        01:21:23 /local/mysql/support/ent/agent/libexec/mysql-monitor-agent –defaults-file=/local/mysql/support/ent/agent/etc/mysql-monitor-agent.ini –daemon –pid-file=/local/mysql/support/ent/agent/mysql-monitor-agent.pid
root     18464 18337  0 17:36 pts/7    00:00:00 mysql -uroot -p
root     18466 18339  0 17:36 pts/9    00:00:00 mysql -uroot -p
root     18467 18338  0 17:36 pts/8    00:00:00 mysql -uroot -p
root     18468 18342  0 17:36 pts/10   00:00:00 mysql -uroot -p
root     21025 18353  0 21:32 pts/11   00:00:00 grep mysql
root     30363     1  0 Jul26 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe –datadir=/local/mysql/data –pid-file=/local/mysql/data/mysqld.pid
mysql    31499 30363 17 Jul26 ?        10-22:08:28 /usr/sbin/mysqld –basedir=/usr –datadir=/local/mysql/data –plugin-dir=/usr/lib64/mysql/plugin –user=mysql –log-error=/var/log/mysqld/mysqld.err –open-files-limit=65535 –pid-file=/local/mysql/data/mysqld.pid –socket=/tmp/mysql.sock –port=3306

root@@my-host001:/home/mani#ll /tmp
total 20
drwxrwxrwt  3 root root 4096 Sep 27 21:32 .
drwxr-xr-x 25 root root 4096 Dec  3  2010 ..
drwxrwxrwt  2 root root 4096 Dec  3  2010 .ICE-unix

root@@my-host001:/home/mani#ps -ef | grep mysql
root      1981     1  0 Jul26 ?        00:00:00 /local/mysql/support/ent/agent/libexec/mysql-monitor-agent –defaults-file=/local/mysql/support/ent/agent/etc/mysql-monitor-agent.ini –daemon –pid-file=/local/mysql/support/ent/agent/mysql-monitor-agent.pid
root      1982  1981  0 Jul26 ?        01:21:23 /local/mysql/support/ent/agent/libexec/mysql-monitor-agent –defaults-file=/local/mysql/support/ent/agent/etc/mysql-monitor-agent.ini –daemon –pid-file=/local/mysql/support/ent/agent/mysql-monitor-agent.pid
root     18464 18337  0 17:36 pts/7    00:00:00 mysql -uroot -p
root     18466 18339  0 17:36 pts/9    00:00:00 mysql -uroot -p
root     18467 18338  0 17:36 pts/8    00:00:00 mysql -uroot -p
root     18468 18342  0 17:36 pts/10   00:00:00 mysql -uroot -p
root     21028 18353  0 21:33 pts/11   00:00:00 grep mysql
root     30363     1  0 Jul26 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe –datadir=/local/mysql/data –pid-file=/local/mysql/data/mysqld.pid
mysql    31499 30363 17 Jul26 ?        10-22:08:42 /usr/sbin/mysqld –basedir=/usr –datadir=/local/mysql/data –plugin-dir=/usr/lib64/mysql/plugin –user=mysql –log-error=/var/log/mysqld/mysqld.err –open-files-limit=65535 –pid-file=/local/mysql/data/mysqld.pid –socket=/tmp/mysql.sock –port=3306
root@@my-host001:/home/mani#  killall -9 mysqld_safe mysqld

Note: Beware that killall behaves differently on Solaris and other OS.

Blog at WordPress.com.