Cannot access MySQL Database - PID file could not be found
5,300
Here is something you can do. Since the process is not running and it is not finding a pid file, you can designate it in your my.cnf file:
- Use a text editor like Vim or Nano to access /etc/my.cnf
- Add the following:
pid-file = /var/run/mysqld/mysqld.pid
- Create the directory/file:
mkdir /var/run/mysqld
touch /var/run/mysqld/mysqld.pid
chown -R mysql:mysql /var/run/mysqld
- Start up MySQL:
service mysql start
- Tail log files to make sure MySQL starts up correctly:
tail -f /path/to/mysql.log
Related videos on Youtube
Author by
MRF
Updated on September 18, 2022Comments
-
MRF over 1 year
I am using a Linux Server from GoDaddy, and without any known reason, PID file could not be found! These are the errors I got:
# mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) # service mysqld status mysqld: unrecognized service # service mysql stop ERROR! MySQL manager or server PID file could not be found! # service mysql start ERROR! Manager of pid-file quit without updating file. # mysqladmin retart mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)' Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
-
Matej Vrzala M4 over 5 yearsI run into this from time to time... Can you run
ps -ef | grep mysql
and post the output -
MRF over 5 years@ryekayo -- I get this: root 15953 20471 0 15:56 pts/0 00:00:00 grep mysql
-
-
MRF over 5 yearsafter stage 4, I get this: Starting MySQL. ERROR! Manager of pid-file quit without updating file.
-
Matej Vrzala M4 over 5 yearsCan you post the output and the contents of your log file in your question?
-
MRF over 5 yearsI am not sure which log to check. I think it can be something about InnoDB --- I tried to post the log, but it is too long