I had two database, one on windows server, and one on linux server, I moved the database to the linux server, but I faced wit a problem, On windows when a made a selection foe example

SELECT * FROM tabledata

Worked fine.

but linux it's not working, because the original table names is tableData

Is there any way to configuration the mysql to case-insensitive?


A prime example of screwed up cross-plattform design. From the MySQL documentation on this point:

the case sensitivity of the underlying operating system plays a part in the case sensitivity of database and table names. This means database and table names are not case sensitive in Windows, and case sensitive in most varieties of Unix.

Fortunately, there is the lower_case_table_names configuration directive, which, when set to 2, would disable case sensitivity for comparisons.


Why not just rename the table?

ALTER TABLE tableData RENAME TO tabledata;
  • Ok, But I have more than 100 tables. – OHLÁLÁ Jun 17 '11 at 8:59
  • Oh, fun... Perhaps write a quick script to do that for all tables? Probably a 30-minute job, depending on what scripting language you use. Or you might be able to stop the mysql server, rename the underlying tables, and start it again. I know that used to work for MyISAM tables; I'm not sure if that's possible with InnoDB. – Flimzy Jun 17 '11 at 9:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.