MySQL 8.0 Doesn't Support Modifying the Case of Table Names
When creating a TencentDB for MySQL instance, you can enable or disable case sensitivity for table names. Note that for instances with MySQL 5.5/5.6/5.7, you can modify the lower_case_table_names parameter in the console to adjust the case sensitivity of table names. However, for MySQL 8.0 instances, you can only choose whether to enable case sensitivity for table names during instance purchase, and you cannot adjust it by modifying the lower_case_table_names parameter after the instance is created.
In MySQL 8.0, the lower_case_table_names parameter can only be set during database server initialization using a configuration file or command-line parameter, and it cannot be changed afterward. Subsequent changes to this parameter will affect the creation method of the database system tables. Moreover, changing the parameter after the system tables are created will result in incompatibility with database object names, causing issues with your application. Therefore, TencentDB for MySQL 8.0 prohibits the modification of the lower_case_table_names parameter and allows it to be set only during instance purchase.
For the correspondence between the database version and the case-sensitive parameter setting of the table name, you can see the table below.
Category
Database Versions
Support Parameter Modification
Note
lower_case_table_names
MySQL 5.5/5.6/5.7
This feature is supported.
-
MySQL 8.0
Unavailable
In order to avoid application problems caused by parameter modification, you can only enable or disable the table name case sensitivity when creating an instance on the purchase page.
The error reporting and troubleshooting steps described below are for MySQL 5.5/5.6/5.7 instances. If your run a MySQL 8.0 instance, you only need to understand the above table name case sensitivity description.
Problem
Failed to enable case insensitivity. An error was reported as follows:
Possible Cause
Database or table names contain uppercase letters.
Instructions
Check whether all of the database and table names of the instance are lowercase, convert uppercase names (if any) to lowercase ones, and modify the lower_case_table_names parameter.
Note
Modifying lower_case_table_names will cause the database restart.
Check if there are uppercase table names
select table_schema,table_name from information_schema.tables where table_schema not in("mysql","information_schema") and (md5(table_name)<>md5(lower(table_name)) or md5(table_schema)<>md5(lower(table_schema)));
Check if there are uppercase database names
select SCHEMA_NAME from information_schema.SCHEMATA where md5(SCHEMA_NAME)<>md5(lower(SCHEMA_NAME));