Mysql table name case-insensitive configuration methods
Mysql in linux is case sensitive by default. Whether mysql is case sensitive is determined by the lower_case_table_names parameter, where:
1) lower_case_table_names = 0
It is case sensitive (that is, it is not case sensitive). This setting is used by default. After this setting, the table name created in mysql does not contain uppercase letters, and can be read and referenced normally.
2) lower_case_table_names = 1
It is case insensitive (that is, it is case sensitive ). After this setting, the table name is saved in lower case on the hard disk, and MySQL converts all the table names to lower case storage and query tables.This behavior is also suitable for database names and table aliases..
That is to say, after mysql is set to be case-insensitive, the database or table is created regardless of whether uppercase letters are used during creation. After the creation is successful, it is forcibly saved in lower case!
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) The table alias is case sensitive;
3) column names and column aliases are case-insensitive in all cases;
4) variable names are case sensitive;
5) MySQL is case-insensitive in Windows, but is case-sensitive by default in Linux.
6) If you want to query the case sensitivity of the time zone field value, you need to set the BINARY Attribute for the field value. There are multiple methods to set it:
A) set at creation:
Create table t (a varchar (10) BINARY );
B) Use alter to modify
Therefore, in order to make programs and databases run normally in different operating systems, the best way is to convert tables to lower case when designing them !!
Modify mysql to be case insensitive:
Mysqladmin-uroot-p shutdown // close the database in Safe Mode
Modify my. cnf // Add the following row
.....
[Mysqld]
Lower_case_table_names = 1
.....
Start mysql
The above explanation of the case-insensitive configuration method for mysql table names is all the content that I have shared with you. I hope you can give me a reference and support the help house.