In our environment we had run cluster fencing tests, after hard-reboot our MySQL will not start.
# service mysqld status mysqld is stopped
# service mysqld start Another MySQL daemon already running with the same unix socket. Starting mysqld: [FAILED]
The Solution
The root cause of the above error is that MySQL was not closed properly, during database shutdown. Due to this socket file is not removed by MySQL and had to be removed manually.
1. Verify that MySQL is not running on your system:
# ps aux | grep -i sql root 10154 0.0 0.0 103252 840 pts/0 S+ 11:21 0:00 grep -i sql
2. Remove leftover socket file using following command:
# rm -Rf /var/lib/mysql/mysql.sock
3. Start the MySQL database and verify if its running properly.
# service mysqld start
# service mysqld status