Using MySQL in heterogeneous environments.

If like us you have a requirement to run MySQL in a mixed Windows and Linux environment and you want your database to be portable you will need to change the default case sensitive table name behaviour of MySQL on one of the operating systems. On Windows the default behaviour is case insensitive, on Linux the default behaviour is case sensitive.

I like my table names to stay in the same case I scripted them in so we chose to change Windows to be case sensitive. The fix is pretty simple – you just need to add the following line to your my.ini after [mysqld] and restart your mysql service.

lower_case_table_names = 0

Existing objects won’t suddenly change case, but any new tables you add to your database will appear in the same case you scripted it in. See the mysql documentation for more details.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s