MySQL table name default Windows case-insensitive in Linux case-sensitive

Source: Internet
Author: User
Tags aliases

MySQL under Linux database name, table name, column name, alias casing rules:
1, database name and table name are strictly case-sensitive

2, table aliases are strictly case-sensitive

3, column name and column alias in all cases are ignored case

4. Variable names are also strictly case-sensitive

Attention:

A, Linux under the default after MySQL installation: Differentiate the case of the table name, do not distinguish the case of the column name

B, change the case of the table name to distinguish the rules of the method: Log in with the root account, in/etc/my.cnf or/etc/mysql/my.cnf [mysqld] After adding Lower_case_table_names=1, restart the MySQL service, If the setting is successful, the case of the table name is no longer distinguished.

Note: If you cannot find my.cnf in/etc or/etc/mysql, you need to copy it from somewhere else, because you need to copy the my.cnf manually when installing MySQL with RPM. Specific operation:

Find the *.cnf file under/usr/share/mysql/, copy one of them to/etc/and rename it to MY.CNF). The command is as follows:

[Email protected] mysql]# CP/USR/SHARE/MYSQL/MY-MEDIUM.CNF/ETC/MY.CNF

which

MY-SMALL.CNF is designed for small databases. This model should not be used for databases that contain some common items.
MY-MEDIUM.CNF is designed for medium-sized databases.

MY-LARGE.CNF is designed for computers that are dedicated to a single SQL database.

MY-HUGE.CNF is designed for databases in the enterprise.

[Windows]

MySQL database names, table names, column names, aliases are not case-sensitive under Windows.


If you want to distinguish the case, then the mysqld part inside the My.ini


Join Lower_case_table_names=0

 Note: Even if you change this setting in Windows, it is not case-sensitive at query time. The case is only different when the export is imported.

MySQL table name default Windows case-insensitive in Linux 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.