Help Center> Relational Database Service> FAQs> Database Parameter Modification> How Do I Set Case Sensitivity for RDS for MySQL Table Names?
Updated on 2024-05-13 GMT+08:00

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:

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.
    1. Log in to the management console.
    2. Click in the upper left corner and select a region and a project.
    3. Click in the upper left corner of the page and choose Databases > Relational Database Service.
    4. On the Instances page, click the instance name.
    5. 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.

    6. Click Save. In the displayed dialog box, click Yes.
    7. Return to the DB instance list, locate the DB instance, and choose More > Reboot in the Operation column.
    8. 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.
    1. Log in to the management console.
    2. Click in the upper left corner and select a region and a project.
    3. Click in the upper left corner of the page and choose Databases > Relational Database Service.
    4. On the Instances page, click and then click the target read replica name.
    5. 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.

    6. Click Save. In the displayed dialog box, click Yes.
    7. Return to the DB instance list, locate the primary DB instance, and choose More > Reboot in the Operation column.
    8. In the displayed dialog box, click OK to reboot the DB instance for the modification to take effect.
    9. On the Instances page, click the primary instance name.
    10. 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.

    11. Click Save. In the displayed dialog box, click Yes.
    12. Return to the DB instance list, locate the primary instance, and choose More > Reboot in the Operation column.
    13. 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 Buy a 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.

Database Parameter Modification FAQs

more