Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

Friday, 16 November 2012

ERROR! MySQL is running but PID file could not be found

You may get the below Error:

[root@server ~]# /etc/init.d/mysql status
ERROR! MySQL is running but PID file could not be found


Fix:


1.Check for mysql directory:

[root@server ~]# ll /var/run/mysql
ls: /var/run/mysql: No such file or directory


2.Create a mysql directory:

[root@server ~]# mkdir /var/run/mysql

3.Enter into the created directory:

[root@server ~]# cd /var/run/mysql/

4.Create the mysqld process id:

[root@server mysql]# touch mysqld.pid

5.Changing the ownership of mysqld.pid

[root@server mysql]# chown mysql:mysql mysqld.pid

6.Restart the MySQL:

[root@server mysql]# /etc/init.d/mysql restart
 ERROR! MySQL manager or server PID file could not be found!
Starting MySQL..................................................................                                                                     .................................. SUCCESS!



7.Check the Status of MySQL:

[root@server mysql]# /etc/init.d/mysql status
 SUCCESS! MySQL running (1583)
Thats it!!!