How to Configure MySQL to be Case Insensitive?

I know that set the lower_case_tables_names can do it. But in Aiven MySQL, how should I do?

  1. Access your Aiven MySQL instance: Log in to the Aiven web console or use the Aiven command-line interface (CLI) to access your MySQL service.
  2. Modify the configuration: Aiven provides a way to modify certain parameters of your service through the web console or CLI. You’ll need to modify the my.cnf configuration file.
  3. Set lower_case_table_names: In your my.cnf file, set the lower_case_table_names parameter to the desired value. This parameter determines how the MySQL server handles table names’ case sensitivity.You can set it to either 0, 1, or 2:
  • 0: Table names are stored as specified and comparisons are case sensitive.
  • 1: Table names are stored in lowercase on disk and comparisons are not case sensitive. This is what you want for a case-insensitive setup.
  • 2: Table names are stored as given but compared in lowercase.
avn service update -t my-service-name -c "my.cnf:lower_case_table_names=1"
.

Replace my-service-name with the name of your Aiven MySQL service

SHOW VARIABLES LIKE 'lower_case_table_names';

This should return the value you set earlier.

I hope By following these steps, you should be able to configure MySQL to be case insensitive in your Aiven environment.

Best regard
Danish Hafeez | QA Assistant
ICTInnovations