The lower_case_table_names
setting tells mysql how to store and compare table names. If the file system the database is stored on is itself not case-sensitive, it will force you to use lower_case_table_names=2
.
The MacOS filesystem is not case-sensitive. Up until Docker Desktop 2.4, the mysql container apparently didn't know that the underlying filesystem is not case-sensitive and set lower_case_table_names=0
. However, since upgrading to Docker 2.4, Docker is apparently smarter about how it mounts volumes. So the container realizes its running on a case-insensitive filesystem and forces lower_case_table_names=2
. The problem is that you cannot change the value of lower_case_table_names
after initializing the database. And since the data dictionary was initialized with lower_case_table_names=0
, it will fail to initialize with the server set to lower_case_table_names=2
.
The only solution I've found is to:
- Downgrade to Docker Desktop 2.3
- Backup the entire database
- Upgrade to Docker 2.4
- Delete the volume storing the database.
- Reinitialize the database.
- Restore the database from backup.
UPDATE: See this answer below for a better solution. There is apparently no need to downgrade. You can instead disable "gRPC Fuse for filesharing", backup the database, re-enable gRPC fuse, delete your database data folder, and restore the database from backup.