In Linux, MySQL is case-insensitive and mysql is case-insensitive.
MySQL in Linux Database Name, table name, column name, alias case-sensitive rules:
1. The database name and table name are case sensitive.
2. The table alias is case sensitive.
3. The column name and column alias are case-insensitive in all cases.
4. Variable names are case sensitive.
Note:
A. After MySQL is installed in Linux, the default value is case-sensitive for table names, but not for column names.
B. How to change the case sensitivity rules of table names: Log On with the root account and log on to/etc/my. cnf or/etc/mysql/my. add lower_case_table_names = 1 under [mysqld] In cnf
Java code
- # The MySQL server
- [Mysqld]
- Port = 3306
- Socket =/var/lib/mysql. sock
- Skip-external-locking
- Key_buffer_size = 16 M
- Max_allowed_packet = 1 M
- Table_open_cache = 64
- Sort_buffer_size = 512 K
- Net_buffer_length = 8 K
- Read_buffer_size = 256 K
- Read_rnd_buffer_size = 512 K
- Myisam_sort_buffer_size = 8 M
- # Add here
- Lower_case_table_names = 1
Restart the MySQL service. If the configuration is successful, the table name is not case sensitive.
MySQL databases, table names, column names, and aliases in Windows are case-insensitive.
If you want to use case-sensitive data, use the mysqld section in my. ini.
Add lower_case_table_names = 0
Note: even if this setting is changed in Windows, the query is case insensitive. Only the case sensitivity is different during import and export.