简体   繁体   中英

Import mysql dump from Linux to Windows with tables names case preserved

I've created a MySQL dump from Linux box. When I see the content of the dump file table names case is preserved but when I'm importing the same dump into Windows box it is loosing the table name cases.

It seems like you should set lower_case_table_names=2 on Windows (by default it is 1). In this case table and database names are stored on disk using the lettercase specified in the CREATE TABLE or CREATE DATABASE statement, but MySQL converts them to lowercase on lookup.

See: http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html for full details.

Use lower_case_table_names=1 on all systems . The main disadvantage with this is that when you use SHOW TABLES or SHOW DATABASES, you do not see the names in their original lettercase.

Use lower_case_table_names=0 on Unix and lower_case_table_names=2 on Windows . This preserves the lettercase of database and table names. The disadvantage of this is that you must ensure that your statements always refer to your database and table names with the correct lettercase on Windows. If you transfer your statements to Unix, where lettercase is significant, they do not work if the lettercase is incorrect.

Exception: If you are using InnoDB tables and you are trying to avoid these data transfer problems, you should set lower_case_table_names to 1 on all platforms to force names to be converted to lowercase.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM