Database and table names are case insensitive in Windows, and are case sensitive on most types of Unix systems
The Windows version of MySQL defaults to the case of the OS, even if there is a distinction in SQL, the import will be converted to lowercase, if you will export this database in the future there may be case case. My.ini has properties lower_case_table_names can change this default, to be strictly case-sensitive, set this entry to 2, and then restart the MySQL service.
Reference:
[Mysqld]
lower_case_table_names=2 if not, you canadd a line in the MySQL configuration file My.ini [mysqld]
Lower_case_table_names = 2
Note: My.ini is not in \ c
Program Files\mysql\mysql Server 5.5, but in: \ c
ProgramData\mysql\mysql Server 5.5\my.ini
However, the query is available in Windows. To avoid differences, it is best to use a consistent conversion, such as always creating and referencing the database name and table name in lowercase. This conversion is recommended in most porting and use.
How to save and use table names and database names on your hard disk in MySQL is determined by the LOWER_CASE_TABLES_NAME system variable and can be set when you start mysqld . Lower_case_tables_name can take any of the following values:
Value |
Meaning |
0 |
Save the table name and database name on your hard disk using the uppercase and lowercase specified by the CREATE TABLE or CREATE DATABASE statement. The name comparison is case sensitive. This is the default setting in UNIX systems. Note that if you force the--lower-case-table-names=0 to 0 on a case-insensitive file system and access the MyISAM table name with a different casing, the index corruption will occur. |
1 |
The table name is saved in lowercase on the hard disk, and the name comparison is case sensitive. MySQL converts all table names to lowercase for storage and lookup. This behavior is also appropriate for database names and table aliases. This value is the default value in Windows and Mac OS x systems. |
2 |
The table name and database name are saved on the hard disk using the case specified by the CREATE TABLE or CREATE DATABASE statement, but MySQL converts them to lowercase for lookup. The name comparison is case sensitive. Note: applies only on file systems that are not case sensitive! InnoDB table names are saved in lowercase, such as lower_case_tables_name=1. |
Change MySQL table and field case sensitivity