When your mysql server crashes and won't restart

This just happened to me: mysql went down for no apparent reason and I thought it was because I was missing with the .ini file. No matter how I tried, it wouldn't restart.

I checked the error logs and found:

InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11

This was an indicator that a mysql process was already running it, but I couldn't find it on top, or using
ps aux | grep mysql 

So I tried this:

# lsof -i:3306

COMMAND   PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
mysqld  24416 mysql   10u  IPv4 173905      0t0  TCP localhost:mysql (LISTEN)

# sudo kill 24416
# sudo /etc/init.d/mysql start

That's all it took.

In this case.


No comments:

Post a Comment