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 in the [mysqld] Add add Lower_case_table_names=1
Java code
- # The MySQL server
- [Mysqld]
- Port = 3306
- Socket =/var/lib/mysql/mysql.sock
- Skip-external-locking
- Key_buffer_size = 16M
- Max_allowed_packet = 1M
- Table_open_cache =
- Sort_buffer_size = 512K
- Net_buffer_length = 8K
- Read_buffer_size = 256K
- Read_rnd_buffer_size = 512K
- Myisam_sort_buffer_size = 8M
- # Add here
- lower_case_table_names=1
Restart the MySQL service, and if the settings are successful, the table name case is no longer distinguished.
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.
Linux settings MySQL is case insensitive