MySQL case sensitivity of table names between windows and linux systems

While I normally stick to all lowercase table names for my MySQL database tables, I often have to come in on a project where the database has already been set up using a mixture of lower and uppercase table names. Because windows is case-insensitive, when you create a MySQL table or export tables for use on a linux system, all table names will be lowercase by default. This will cause problems when the dump imported into MySQL on linux, as any calls to the original mixed case tables will result in errors, as these tables don't actually exist.

To fix this, you can look for the setting: lower_case_table_names in your my.ini file, found in or around: C:\Program Files\MySQL\MySQL Server 4.1, depending on which version you are running. If you don't find the setting, you can just add it to the end of the my.ini file, as I did, like so:

lower_case_table_names=0

Remember to restart the MySQL service before you test whether or not it works.

You can also set this value to 2 if you want, and then: "MySQL converts them to lowercase on lookup. Name comparisons are not case sensitive."

Please check out the MySQL website for additional information about this, and some important warningshttp://dev.mysql.com/doc/refman/4.1/en/identifier-case-sensitivity.html

Comments

best ugg boots sale store,The

best ugg boots sale store,The ugg boots made form top qulity merino sheepskin.Our cheap ugg boots are comfortable enough to wear all day. UGGbfgfb

Set lower_case_table_names

Set lower_case_table_names to 1. It will be case insensitive whatever OS you run it under.

it may sound absurd..... but

it may sound absurd..... but can we make it case insensitive on linux in any way??

This was really helpful to

This was really helpful to me - testing on Windows, with the online system in Unix, with mixed case table names - a recipe for disaster.

I set lower_case_table_names=0.

I notice that when I create a table called abC then it is now saved as abC, as expected. If I say "SELECT * FROM abc", I get no records returned, I have to say "SELECT * FROM abC". However, I don't get an error message.

If I say "SELECT * FROM abCd", I get Error Code : 1146, Table 'test.abCd' doesn't exist - but I never see "test.abc doesn't exist", so that is something to watch out for.