A study on MySQL case-sensitivity problem

Source: Internet
Author: User

First say the problem encountered: There is a MySQL instance ran two libraries, two sets of programs. One of the library's table names is all uppercase, and the other library's table names are all lowercase.

The program with the table named lowercase is capitalized when the SQL statement is written, and the runtime prompts you not to find the table. So you need to add "Lower_case_table_names = 1" in my.cnf to make MySQL ignore case. But with this, the set of programs that cause the table name to be capitalized will not find the table, and the table is not found either by using the query statement with the uppercase or lowercase table names.

Finally, the issue is resolved by converting the uppercase table name to a lowercase table name using the ALTER TABLE capitalization table name rename to lowercase table name.

If you have a problem, be aware of MySQL's case sensitivity or not, depending on the case sensitivity of the operating system.

So on the Windows platform, MySQL is case-insensitive;

On the Linux platform:

Both the library name and the table name (and the alias of the table) are strictly case-sensitive;

Column names are case insensitive.

To look back at the problem above, the reason for the addition of ignoring the case of the parameter, but still cannot access the capital table name of the table, because the uppercase table name in the file System Storage table file is also uppercase storage (such as table LJK corresponding ljk.frm; table LJK corresponds to LJK.FRM), and The result of MySQL ignoring the case is "to handle the library name and table name in the SQL statement in lowercase", which in fact causes the table structure and table data files to not be found at the system level, so for uppercase tables and libraries, open "Lower_case_table_names = 1" will not be accessible.



A study on MySQL case-sensitivity problem

Related Article

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.