In MySQL on Windows, the table name is in lowercase.

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.