MySQL table names in Linux are case-insensitive.
Scenario: Recently, the company switched the database from Oracle to MySQL. Since the table names in Oracle are case insensitive, the problem of table names not found in MySQL occurs, it is found that MySQL table names in Linux are case-sensitive, but some parameters can make them case-insensitive. The procedure is as follows:
I. MySQL Case details in Linux:
1. Database names are case sensitive
2. The table name is case sensitive.
3. Table aliases are case sensitive.
4. Variable names are case sensitive
5. The column names are case-insensitive in all cases.
6. The column alias is case-insensitive in all cases.
Ii. Set the MySQL table name to be case insensitive
1. Switch to the root user
$ Su-root
2. Modify the/etc/my. cof configuration file,
# Sed-I '/mysqld/a \ lower_case_table_names = 1'/etc/my. cnf
Lower_case_table_names parameters:
- 0: Case Sensitive
- 1: case insensitive
3. Restart MySQL
# Service mysqld restart
4. View mqsql Parameters
# Mysql-uroot-p
> Show variables like "% case % ";
+ ------------------------ + ------- +
| Variable_name | Value |
+ ------------------------ + ------- +
| Lower_case_file_system | OFF |
| Lower_case_table_names | 1 |
+ ------------------------ + ------- +
2 rows in set (0.00 sec)
Iii. Others
In Windows, MySQL is always case-insensitive.
This article permanently updates the link address: