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