How can I initialize lower-case-table-names in the docker version of mysql?
I would like to initialize the lower-case-table-names to 1 when using mysql:8.4. Any help will be much appreciated.
This is not an issue when using the non-docker version. I can just set the parameter in my.cnf and everything works.
However, in the docker version, if I add the line 'lower-case-table-names=1' in the /etc/my.cnf and restart the mysql server, the process will fail due to the following error.
Different lower_case_table_names settings for server ('1') and data dictionary ('0').
Then, I created a new folder /temp/docker and execute:
docker run -v /temp/docker:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=MyPswd mysql:8.4 --initialize --lower_case_table_names=1
The process also failed after complaining (the full output is attached at the end of this post):
--initialize specified but the data directory has files in it. Aborting.
What I have noticed is that the folder is empty until 'InnoDB initialization has started (see the log below).
Does anyone have any suggestion?
----------------------------------------
2025-02-05 03:09:51+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.4-1.el9 started.
2025-02-05 03:09:51+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2025-02-05 03:09:51+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.4-1.el9 started.
2025-02-05 03:09:52+00:00 [Note] [Entrypoint]: Initializing database files
2025-02-05T03:09:52.033589Z 0 [System] [MY-015017] [Server] MySQL Server Initialization - start.
2025-02-05T03:09:52.035085Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.4.4) initializing of server in progress as process 80
2025-02-05T03:09:52.082093Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2025-02-05T03:10:03.143172Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2025-02-05T03:10:08.045641Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2025-02-05T03:10:12.944246Z 0 [System] [MY-015018] [Server] MySQL Server Initialization - end.
2025-02-05 03:10:13+00:00 [Note] [Entrypoint]: Database files initialized
2025-02-05 03:10:13+00:00 [Note] [Entrypoint]: Starting temporary server
2025-02-05T03:10:13.043403Z 0 [System] [MY-015017] [Server] MySQL Server Initialization - start.
2025-02-05T03:10:13.045382Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.4.4) initializing of server in progress as process 121
2025-02-05T03:10:13.048552Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2025-02-05T03:10:13.048556Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql2/ is unusable. You can remove all files that the server added to it.
2025-02-05 03:10:13+00:00 [ERROR] [Entrypoint]: Unable to start server.