Home > Article > Operation and Maintenance > Are mysql table names case sensitive in linux?
MySQL table names in Linux are case-sensitive; MySQL database names, table names, variable names, and table aliases are all strictly case-sensitive in Linux, while column names and column aliases are all case-sensitive. Case is ignored in all cases. You can modify the "ower_case_table_names" parameter in the MySQL configuration file to set whether it is case sensitive.
The operating environment of this tutorial: linux7.3 system, mysql8.0.22 version, Dell G3 computer.
In Linux, after the MySQL installation is completed, the table name is case-sensitive by default, and this attribute cannot be modified. It is said on the Internet in /etc/mysql The configuration of added fields in /my.cnf will not take effect, and mysql will fail to start after modification.
The table name of mysql is case-sensitive in Linux, but the table name of mysql in Windows is not case-sensitive; you can add a line "ower_case_table_names = parameters" in the MySQL configuration file "my.ini [mysqld]" to Set whether to be case sensitive.
MySQL's case rules for database names, table names, column names, and aliases under Linux are as follows:
There is a strict distinction between database names and table names. Case;
Table aliases are strictly case-sensitive;
Column names and column aliases are in all Case is ignored in all cases;
Variable names are also strictly case-sensitive;
MySQL is not case-sensitive under Windows Write.
So in order to make the program and database run normally in different operating systems, the best way is to convert them to lowercase during design. However, if the case has been normalized during design, then In the Windows environment, you only need to make changes to the database configuration.
The specific operations are as follows:
Add a line ower_case_table_names = 1# in the MySQL configuration file my.ini [mysqld]
##Parameter explanation:The above is the detailed content of Are mysql table names case sensitive in linux?. For more information, please follow other related articles on the PHP Chinese website!