Symptoms
If MySQL is failing to restart with the following error, it may likely mean that an old MySQL process is running.
[ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
[Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
[ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
[Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
Description
As the error suggests, this error often means that another process for MySQL is currently running. You can check this using the command:# ps faux | grep mysql[d]
For example:
# ps faux | grep mysql[d]
root 2382 0.0 0.0 113628 1548 ? S Apr19 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/testing5.cpaneltechs.tld.pid
mysql 2382 0.3 8.0 1790796 327320 ? Sl Apr19 4:35 \_ /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/testing5.cpaneltechs.tld.err --pid-file=/var/lib/mysql/testing5.cpaneltechs.tld.pid
mysql 12382 0.1 1.2 652576 49576 ? Ssl 13:38 0:00 /usr/sbin/mysqld
As shown above, there is an older MySQL process from an older date.
Workaround
The safest way to resolve this is to stop the older MySQL process. This can normally be done using the command:
systemctl stop mysql.service
Then restart MySQL using the command shown here:
/scripts/restartsrv_mysql
Also, these errors can be caused by a failed process from CloudLinux's MySQL Governor. If you are using MySQL Governor, please also ensure that the Governor service is working before starting your MySQL service. You can attempt to restart this process using this command:
systemctl restart db_governor.service
Comments
0 comments
Article is closed for comments.