Problem
When I execute DDL statements to my MySQL database on my Mac installation, every table is converted to lowercase letters - even if the name is in uppercase letters in my script. This leads to errors in ALTER TABLE operations to add foreign keys (because of case sensitive).
Solution
According to this page:
How table and database names are stored on disk and used in MySQL is affected by the lower_case_table_names system variable, which you can set when starting mysqld. lower_case_table_names can take the values shown in the following table. This variable does not affect case sensitivity of trigger identifiers. On Unix, the default value of lower_case_table_names is 0. On Windows the default value is 1. On Mac OS X, the default value is 2.
I updated my my.cnf file:
$ sudo nano /private/etc/my.cnf
... by adding the following line:
lower_case_table_names=0
Add new comment