Troubleshooting
Problem
MySQL fails to start after a power outage due to left over socket file. Therefore, RTM is down.
Symptom
On starting mysqld service, get the following error -
# service mysqld start
Another MySQL daemon already running with the same unix socket.
Starting mysqld: [FAILED]
Cause
If the MySQL service does not shut down gracefully during the OS reboot, the old /var/lib/mysql/mysql.sock has been left behind. This prevents 'mysqld' from starting up.
# ls -al /var/lib/mysql/mysql.sock
srwxrwxrwx 1 mysql mysql 0 Apr 28 2016 /var/lib/mysql/mysql.sock
Diagnosing The Problem
First check if mysqld is not running and default port 3306 is not used up
# ps -aef | grep -i mysql
# netstat -tupna | grep -w 3306 (to check if port is not already in use)
Resolving The Problem
If port 3306 is not used up and mysqld is not running, delete the socket file and restart mysqld
# rm -f /var/lib/mysql/mysql.sock
# service mysqld start
If port 3306 is used up by mysqld, but you cannot connect to mysql prompt, there may be some other issue related to DB corruption. Contact support.
Related Information
Was this topic helpful?
Document Information
Modified date:
30 August 2019
UID
isg3T1024854