MySQL Error: InnoDB: Unable to lock ibdata1, error: 11

MySQL Error: error: 11

If you are getting error: 11 while trying to start or restart the mysql service this might be a problem of having multiple mysql processes locking the ibdata.
To fix this issue you need first to list all the mysql process that might be running in the background and locking it.

ps aux | grep -i mysql

Output example:

ps aux | grep mysql
root 5516 0.0 0.0 72596 1600 pts/4 S 12:59 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/mysql/data/mysql_data --pid-file=/mysql/data/mysql_data/mysql.pid
mysql 6253 87.9 17.7 48390828 5825088 pts/4 Rl 12:59 2:51 \_ /usr/sbin/mysqld --basedir=/usr --datadir=/mysql/data/mysql_data --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/mysql/data/mysql_logs/mysql-error-log.err --open-files-limit=65535 --pid-file=/mysql/data/mysql_data/mysql.pid --socket=/mysql/data/mysql_data/mysql.sock --port=3306

Also it will be helpful to check with lsof

lsof -i:3306

If you find any then try to kill that process before trying to restart the service

kill -9 5516 6253

Now start the MySQL service back again

service mysql start

 


Subscribe to
for video tutorials updates