Recently, we want to migrate a database structure on Linux to a Windows system.
Use mysqldump.exe to dump the table creation statement,
After running on Windows, you can see that even though the tables are created, the uppercase letters in the table name are changed to lowercase letters.
After checking the information, we found that MySQL server has a parameter called lower_case_table_names, which controls the case sensitivity of table names.
It can have three values:
0: Case Sensitive
1: case-insensitive when comparing names, but when creating a table, uppercase letters are also converted into lowercase letters.
2: The Case sensitivity is ignored when comparing names. The table is left unchanged when creating a table.
Sadly, the default value of MySQL in Windows is 2, while that in Mac OS is 1. What is it in Linux? It is not mentioned in the document. I guess it is 0.
In Windows, the solution is to write lower_case_table_names = 2 in the command line or option file when starting the server.
In the option file, write this line in the [mysqld] segment.
Refer:
Http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_lower_case_table_names