MySQL Case sensitivity

Source: Internet
Author: User
MySQL database, table name, column name, And alias rules in linux: 1. the Database Name and table name are case sensitive. 2. table aliases are case sensitive. 3. variable names are case sensitive. 4. the column name and column alias are case-insensitive. MySQL is case insensitive in windows. Cause: MySQL is case insensitive when querying strings,

MySQL database, table name, column name, And alias rules in linux: 1. the Database Name and table name are case sensitive. 2. table aliases are case sensitive. 3. variable names are case sensitive. 4. the column name and column alias are case-insensitive. MySQL is case insensitive in windows. Cause: MySQL is case insensitive when querying strings,

Rules for MySQL databases, table names, column names, and aliases in linux:

1. The database name and table name are case sensitive;

2. The table alias is case sensitive;

3. Variable names are case sensitive;

4. The column name and column alias are case-insensitive.

MySQL is case insensitive in windows.

Cause:

MySQL is case-insensitive when querying strings, and generally uses the ISO-8859 character set to seat the default character set when compiling MySQL. This character set is case-insensitive, therefore, the case-sensitivity conversion of Chinese encoding Characters During the comparison process causes this phenomenon.

Solution:

1. The table name is case sensitive;

Add in my. conf

Ower_case_table_names = 0

0: Case Sensitive 1: case insensitive

2. Set the field value to the BINARY attribute.

Case Sensitive

The following are my problems in the project:

A few days ago, when I was working on a project (in a Linux environment), I accidentally shook hands and created two databases with the same table name. When I wrote an SQL query database

Select * from swxx_zxwd and select * from SWXX_ZXWD

Two different 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.