Whether the mysql table name, field name, and field value are case sensitive

Source: Internet
Author: User

1. Whether mysql is case sensitive by default. Use show Variables like '% table_names' to check the lower_case_table_names value. 0 indicates yes, and 1 indicates no.
 
2. mysql is case insensitive for data of the varchar type by default. However, if this field is encoded as "* _ bin", mysql will be case sensitive.
 
3. mysql uses the same field name policy as varchar data. That is, the field is case insensitive by default. However, if the field is "* _ bin" encoded, mysql will be case sensitive.
 
4. mysql uses the same table name policy as varchar data. That is, the table is case insensitive by default. However, if the table is "* _ bin" encoded, mysql will be case sensitive.
 
5. If the value of lower_case_table_names is 0 according to the first item, but mysql is case insensitive by default, you need to add parameters in the mysql configuration file and restart the mysql database. Modify the mysql configuration file as follows:
 
[Mysqld]
...
Lower_case_table_names = 1
 
6. Note: The table and field encoding should inherit the database encoding as much as possible (inheritance is not explicitly specified) to avoid confusion.

Gecko by author

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.