How Do I Set Case Sensitivity for RDS for MySQL Table Names?
You can use either of the following methods to set the case sensitivity:
- Modify parameter lower_case_table_names for created DB instances: RDS for MySQL 5.6 and 5.7
- Specify the case sensitivity during instance creation: For RDS for MySQL 8.0, 5.7, and 5.6, you can specify whether table names are case sensitive when creating DB instances on the console or through an API.
Modifying the Parameter for Created DB Instances
- Before changing the case sensitivity, ensure that each table name is unique in your instance.
- You can change the case sensitivity of table names only when there is no replication delay. To check the replication delay, view the Real-Time Replication Delay metric on the Cloud Eye console.
- Scenario 1: If the DB instance does not have read replicas, modify the parameter of the DB instance and then reboot the DB instance.
- Log in to the management console.
- Click in the upper left corner and select a region.
- Click in the upper left corner of the page and choose Databases > Relational Database Service.
- On the Instances page, click the instance name.
- In the navigation pane, choose Parameters. On the displayed page, change the value of lower_case_table_names.
For example, change the value from 1 to 0, indicating that table names are case sensitive.
- Click Save. In the displayed dialog box, click Yes.
- Return to the DB instance list, locate the DB instance, and choose More > Reboot in the Operation column.
- In the displayed dialog box, click OK to reboot the DB instance for the modification to take effect.
- Scenario 2: If the DB instance has a read replica, first modify the parameter of the read replica, reboot the DB instance, then modify the parameter of the DB instance, and reboot the DB instance again.
- Log in to the management console.
- Click in the upper left corner and select a region.
- Click in the upper left corner of the page and choose Databases > Relational Database Service.
- On the Instances page, click and then click the target read replica name.
- In the navigation pane, choose Parameters. On the displayed page, change the value of lower_case_table_names.
For example, change the value from 1 to 0, indicating that table names are case sensitive.
- Click Save. In the displayed dialog box, click Yes.
- Return to the DB instance list, locate the primary DB instance, and choose More > Reboot in the Operation column.
- In the displayed dialog box, click OK to reboot the DB instance for the modification to take effect.
- On the Instances page, click the primary instance name.
- In the navigation pane, choose Parameters. On the displayed page, change the value of lower_case_table_names.
For example, change the value from 1 to 0, indicating that table names are case sensitive.
- Click Save. In the displayed dialog box, click Yes.
- Return to the DB instance list, locate the primary instance, and choose More > Reboot in the Operation column.
- In the displayed dialog box, click OK to reboot the DB instance for the modification to take effect.
Specifying Case Sensitivity During Instance Creation
- Set Table Name to Case sensitive or Case insensitive on the RDS console during instance creation. For details, see Buying an RDS for MySQL DB Instance.
- Set parameter lower_case_table_names to 0 or 1 when calling an API to create a DB instance. For details, see Creating a DB Instance.
Value range:
- 0: Table names are case sensitive.
- 1: Table names are stored in lowercase and are case insensitive.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot