MySQL problem with capitalization

Source: Internet
Author: User

MySQL under Linux database, table name, column name, alias rules:

1. Database name and table name are strictly case-sensitive;

2. The alias of the table is strictly case-sensitive;

3. Variable names are strictly case sensitive;

4. Column names and column aliases ignore case.

MySQL is not case-sensitive under Windows.

Reason:

MySQL in the query string is case insensitive, in the compilation of MySQL generally with the ISO-8859 character set seat default character set, this character set is not sensitive to case, so in the comparison process of Chinese encoded character case conversion caused this phenomenon.

Solution:

1. The table name is case-sensitive;

Join in My.conf

Ower_case_table_names = 0

0: Case Sensitivity 1: case-insensitive

2. Field value Set binary property

Can be case-sensitive

Below are the problems I have encountered in the project:

A few days ago when doing a project (Linux environment), accidentally shook hands, created two table names the same database, while writing SQL query database, will appear

SELECT * FROM SWXX_ZXWD and select * from SWXX_ZXWD

Two different kinds of results.

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.