MySql crossplatform tip (especially with an ORM)

This is just a small post for my own reference and who knows it might even save someone some work.

I am developing on windows and use Subsonic as an ORM in a current project. At the client site we have a linux server running MySql. We however develop against a MySql on windows. One particular pain point we encountered was that by default on windows all identifiers, including table and column names are transformed in lower case. We got a lot of table not found exceptions when we tried  (and failed) to deploy our newly generated ORM classes at the customer site.

The solution is very simple and the behavior well documented on the MySql site.

In your mysql installation folder (by default: C:\Program Files\MySQL\MySQL Server 5.5) add the following line in the my.ini under the [mysqld] section (which configures the mysql service):

lower_case_table_names=0

After restarting the service your MySql database will have the same identifier casing behavior as a Linux installation.

Tags: