So our target environment is linux, making mysql case-sensitive by default. I am aware that we can make our linux environment not case sensitive with the lower_case_table_names variable, but we would rather not. We have a few times been bitten with a case mismatch because our dev rigs are OSX, and mysql is not case sensitive there.
Is there a way we can force table names to be case sensitive on my OSX install of MySql (5.0.83 if that matters) so that we catch a table name case mismatch prior to deploying to the integration servers running on linux?
Set lower_case_table_names=0
in my.cnf
.
If you installed via homebrew, the file is here:
/usr/local/Cellar/mysql/<version>/my.cnf
Queries with tables should now be case sensitive:
mysql> select count(*) from user;
ERROR 1146 (42S02): Table 'xxx.user' doesn't exist
mysql> select count(*) from User;
+----------+
| count(*) |
+----------+
| 1 |
+----------+
1 row in set (0.00 sec)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With