Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laradock MySQL container exits(0) - Different lower_case_table_names settings for server ('2') and data dictionary ('0')

After installing Docker and Laradock on my Mac I'm trying to start the docker containers using the command:

docker-compose up -d nginx mysql phpmyadmin

I get the output:

Starting laradock_mysql_1            ... done
Starting laradock_docker-in-docker_1 ... done
Starting laradock_phpmyadmin_1       ... done
Starting laradock_workspace_1        ... done
Starting laradock_php-fpm_1          ... done
Starting laradock_nginx_1            ... done

Seems fine, but for some reason MySQL is crashing. When I try to start the container again I get the following message:

mysql_1                | 2020-10-01T10:19:52.124915Z 1 [Warning] [MY-012579] [InnoDB] fallocate(25, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 16384) returned errno: 22
mysql_1                | 2020-10-01T10:19:52.143672Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysql_1                | 2020-10-01T10:19:52.159801Z 1 [ERROR] [MY-011087] [Server] Different lower_case_table_names settings for server ('2') and data dictionary ('0').
mysql_1                | 2020-10-01T10:19:52.160778Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
mysql_1                | 2020-10-01T10:19:52.161607Z 0 [ERROR] [MY-010119] [Server] Aborting
mysql_1                | 2020-10-01T10:19:52.795909Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.21)  MySQL Community Server - GPL.

I tried adding "command: --lower_case_table_names=0" to my docker-compose file, but that does not seem to help.

MySQL crashes with:

mysql_1                | 2020-10-01 10:21:28+00:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config
mysql_1                |        command was: mysqld --lower_case_table_names=0 --verbose --help
mysql_1                |        2020-10-01T10:21:28.547104Z 0 [ERROR] [MY-010158] [Server] The server option 'lower_case_table_names' is configured to use case sensitive table names but the data directory is on a case-insensitive file system which is an unsupported combination. Please consider either using a case sensitive file system for your data directory or switching to a case-insensitive table name mode.
mysql_1                | 2020-10-01T10:21:28.549273Z 0 [ERROR] [MY-010119] [Server] Aborting
like image 396
Wouter Doornbos Avatar asked Oct 01 '20 10:10

Wouter Doornbos


People also ask

What happened to lower_case_table_names in MySQL 8?

MySQL 8 and lower_case_table_names. In MySQL 8, it is no longer allowed to change the value of the lower_case_table_names option after the data directory has been initialized. This is a safety feature – as described in the reference manual: It is prohibited to start the server with a lower_case_table_names setting that is different from the ...

Can lower_case_table_names be configured After initializing the server?

lower_case_table_names can only be configured when initializing the server. Changing the lower_case_table_names setting after the server is initialized is prohibited. It is prohibited to start the server with a lower_case_table_names setting that is different from the setting used when the server was initialized.

How to use case insensitive identifiers in MySQL 8?

To use case insensitive identifiers in MySQL 8, the main thing is that you must set lower_case_table_names = 1 in your MySQL configuration file before you initialize the data directory (this happens on the first start when using systemd ).

Will laradock work with my Docker containers?

We’ll occasionally send you account related emails. Already on GitHub? Sign in to your account After installing Laradock and executing: docker-compose up -d nginx mysql phpmyadmin all the docker containers should run fine.


2 Answers

My solution:

cmd

fsutil file setCaseSensitiveInfo "C:\Users\XXXXX\.laradock\data\mysql"

This will change lower_case_table_names for data dictionary from ('0') to ('2') in Windows 10. XXXXX - your username in Windows 10.

then:

docker-compose up mysql
like image 100
Radik Avatar answered Oct 17 '22 04:10

Radik


This was most likely caused by the docker update to 2.4. See:

Mysql not starting in a docker container on MacOS after docker update

like image 5
user3293116 Avatar answered Oct 17 '22 02:10

user3293116