MySQL keeps crashing: InnoDB: Unable to lock ./ibdata1, error: 11

another approach from one comment in the same blog:

this helped me:

lsof -i:3306

Then kill it (the process number)

kill -9 PROCESS

e.g. kill -9 13498

Then try to restart MySQL again.

via http://www.webhostingtalk.com/archive/index.php/t-1070293.html


with ubuntu 14.04. I'm experiencing this problem when I try to restart via

/etc/init.d/mysql restart

Instead try

service mysql restart 

Solution

make a copy of the original files (ibdata1, ib_logfile0, ib_logfile1...).

mv ibdata1 ibdata1.bak 
cp -a ibdata1.bak ibdata1

http://cglreport.zhenhua.info/2008/08/mysql-error-unable-to-lock-ibdata1.html


The most common cause of this problem is trying to start MySQL when it is already running.

To resolve it, kill off any running instances of MySQL and then restart it using your normal startup scripts, e.g. service mysql start.

Don't attempt to start MySQL manually when using distribution-packaged versions unless you are prepared for a world of hurt.