Question about whether MySQL table name/field name/field value is case-sensitive

Source: Internet
Author: User
Http://www.2cto.com/database/201202/121253.html 1, MySQL is case-sensitive by default, use show Variables like '%table_names ' to view Lower_ The value of the Case_table_names, 0 stands for the distinction, 1 represents not differentiated.

2, MySQL for type varchar data is not case-insensitive by default, but if the field is encoded with "*_bin", it will make MySQL case-sensitive.

3. mysql Policy for field names is the same as varchar type data. That is, the default is case-insensitive, but if the field is encoded with "*_bin", it will make MySQL case-sensitive.

4. mysql Policy for table names is the same as varchar type data. That is, the default is case-insensitive, but if the table is encoded with "*_bin" it will make MySQL case-sensitive.

5, if you follow the first item to view the value of Lower_case_table_names is 0, but need to make MySQL default case-insensitive, you need to add parameters in the MySQL configuration file and restart the MySQL database. The MySQL configuration file is modified as follows:

[Mysqld]
...
Lower_case_table_names = 1

6, Note: Table and field encoding as far as possible to inherit the database encoding (not clearly specified as inheritance), so as not to cause confusion.

Question about whether MySQL table name/field name/field value is case-sensitive

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.