Recently, when I switched a Windows MySQL database to Linux, I encountered a problem that the table could not be found. I analyzed the problem and found that it was a case-insensitive problem.
In MySQL, database and table pairs are stored in directories and files under those directories. Therefore, the sensitivity of the operating system determines the case sensitivity of the database and table names. This means that the database and table names are case-insensitive in windows and are case-sensitive in most types of UNIX systems.
It is strange that the column name and column alias are case-insensitive in all cases, while the table alias is case-sensitive.
To avoid this problem, you 'd better define all the database naming rules in combination with lowercase letters and underscores instead of any uppercase letters.
Alternatively, you can force the-O lower_case_table_names = 1 parameter to start mysqld (if -- defaults-file =... /My. if the CNF parameter is used to read the specified configuration file and start mysqld, you need to add a line lower_case_table_names = 1 in the [mysqld] section of the configuration file ). In this way, MySQL automatically converts all table names to lowercase characters when creating and searching (this option is 1 by default in Windows and 0 in UNIX. From MySQL 4.0.2, this option also applies to the database name ).
When you change this option, you must first convert the old table name to lowercase letters before starting mysqld.
In other words, if you want to retain the case-sensitive characters when creating a table in the database, set this parameter to 0: lower_case_table_names = 1. Otherwise, you will find that the same sqldump script imports different results in different operating systems (all uppercase characters in windows are changed to lowercase letters ).
Modify/etc/My. CNF
[Mysqld]
Lower_case_table_names = 1
0: Case Sensitive, 1: case insensitive
In Linux, the database name, table name, column name, And alias are case-sensitive:
1. The database name and table name are case sensitive;
2. Table aliases are case sensitive;
3. The column name and column alias are case-insensitive in all cases;
4. Variable names are case sensitive;
MySQL is case insensitive in windows.