How to force case sensitive table names?

Ehsan Khodarahmi picture Ehsan Khodarahmi · Jun 6, 2011 · Viewed 91.5k times · Source

I'm working on a MySQL database in windows.

I must move it into a Linux environment. MySQL database contains a lot of tables and stored procedures which are CASE SENSITIVE.

When I backup my database, all table names are forced lowercase so when I restore it in Linux it complains because you can't make duplicate tables and stored procedures.

I don't have access to the MySQL configuration in the linux environment so I cant change MySQL settings to case insensitive mode.

Is there any way to force MySQL (v5.x) to use case sensitive table names in windows?

Answer

ATorras picture ATorras · Mar 28, 2012

Read all this: http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html

Then add this system variable to the server section, [mysqld], of my.ini and restart mysql:

/my.ini: lower_case_table_names=2