Friday, April 16, 2021

How to solve InnoDB: Unable to lock ./ibdata1 mysql error? Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive

Problem Statement:

bash-3.2# /usr/local/mysql/support-files/mysql.server start


Starting MySQL
.................................................................................................... ERROR! The server quit without updating PID file (/usr/local/mysql/data/xx-xxx.pid).
bash-3.2# cat /usr/local/mysql/data/xx-xxxx.pid

 

Root Case :

There might be multiple mysql processes running. Kill them.

Solution:

bash-3.2# ps aux|grep mysql


root             28892   0.9  0.0  4277256    796 s001  S+    1:09PM   0:00.00 grep mysql
 

_mysql           22971   0.0  1.1  4884468 186036   ??  Ss    9:49AM   0:23.22 /usr/local/mysql/bin/mysqld --user=_mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --log-error=/usr/local/mysql/data/mysqld.local.err --pid-file=/usr/local/mysql/data/mysqld.local.pid --keyring-file-data=/usr/local/mysql/keyring/keyring --early-plugin-load=keyring_file=keyring_file.so

sudo kill 22971

Restart the server

bash-3.2# /usr/local/mysql/support-files/mysql.server start

Starting MySQL
. SUCCESS!

Additional information

Error Messages from logs could look like:

bash-3.2# cat /usr/local/mysql/data/amoni-mac.err
2021-04-16T07:05:06.321323Z 0 [System] [MY-010116] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.23) starting as process 27393
2021-04-16T07:05:06.324284Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
2021-04-16T07:05:06.342917Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-04-16T07:05:06.365435Z 1 [ERROR] [MY-012574] [InnoDB] Unable to lock ./ibdata1 error: 35
2021-04-16T07:05:07.368910Z 1 [ERROR] [MY-012574] [InnoDB] Unable to lock ./ibdata1 error: 35
2021-04-16T07:05:08.372637Z 1 [ERROR] [MY-012574] [InnoDB] Unable to lock ./ibdata1 error: 35

No comments:

Post a Comment

Please add value. Sharing is caring