IBM Support

MySQL does not start up after a power outage

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.

[{"Product":{"code":"SSVMSD","label":"Platform RTM"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":"Database","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"","label":""}},{"Product":{"code":"SSZT2D","label":"IBM Spectrum LSF RTM"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"10.1","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
30 August 2019

UID

isg3T1024854