Maintain case sensitivity when importing db into windows
I have an export from a MYSQL database on a linux machine however when importing that database into MYSQL on windows all of the table names that were camel cased are now all lower case. The sql dump has the correct case in it but the importing via phpmyadmin seams to r开发者_如何学Pythonemove these.
How can I import it and keep the case?
There is a setting for mysql to allow case differentiation in windows. You need to edit the my.cnf
file and alter the setting:
lower_case_table_names=2
Then restart mysql.
Otherwise, this may be a case of phpmyadmin changing case in the way it passes queries to the server rather than a linux-to-windows problem. Have you tried importing the sql dump using another mysql manager such as SQLyog? (Tools -> Restore from SQL Dump...)
It is probably worth reading the following page from the MySQL Reference Manual: http://dev.mysql.com/doc/refman/5.5/en/identifier-case-sensitivity.html
Based on that, I think you need to set to 0, not 2, which will ensure that the schema is stored using the same case as defined in your DDL.
lower_case_table_names=0
Go to C:\ProgramData\MySQL\MySQL Server x.x.x, Locate my.ini file add lower_case_table_names=2 at the bottom and restart Server.
Use lower_case_table_names=0 on Unix and lower_case_table_names=2 on Windows.
精彩评论