Under "MySQL" Linux, set MySQL table name to ignore case

Source: Internet
Author: User
Tags mysql in mysql command line

"Barrier Reproduction"

Condition Description 01: A program is often reported in the Linux downgrade can not find the table, but I clearly built a table, testing, encountered some problems, from the Windows platform to access the virtual machine in the Web application, often reported not found the table, but clearly in the database to see the relevant data tables and data, It can also be found in Linux via the MySQL command line, why is it not available from programs on the Windows platform to access MySQL in the virtual machine?

"Cause analysis"

Originally Linux under the default is to distinguish table name case, and under Windows is not differentiated. The data in the data script exported from Windows is in lowercase, and the table name in hibernate-generated SQL is uppercase, so the data cannot be found.

"Solutions"

The way MySQL does not differentiate between table name capitalization is actually simple: 1. Log in with root, modify/ETC/MY.CNF2. Add a line under [mysqld]: Lower_case_table_names=1 Note: 0, case-sensitive; 1, no distinction 3. Restart the database to Sudo/etc/init.d/mysql restart

Expand

Note: (The following excerpt from the Web) MySQL under Linux database name, table name, column name, The alias casing rules are as follows: 1. The database name and table name are strictly case-sensitive 2. The alias of the table is strictly case-sensitive, 3. The alias of the column name and column is ignored in all cases 4. Variable names are also strictly case-sensitive

Under "MySQL" Linux, set MySQL table name to ignore case

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.