Mysql table names in linux are case-insensitive.

11-17-2023

Designed for programming, automatic code writing robot, free to open. This article mainly introduces the case-insensitive knowledge of mysql table names in linux. The content is detailed and easy to understand, the operation is simple and fast, and it has certain reference value. I believe everyone will gain something after reading this case-insensitive article of mysql table names in linux. Let's take a look at it together.

Mysql table names in linux are case-sensitive; Mysql database names, table names, variable names and table aliases are strictly case-sensitive in linux, while column names and column aliases are case-insensitive in all cases. You can modify the power _ case _ table _ names parameter in MySQL configuration file to set whether it is case-sensitive.

Operating environment of this tutorial: linux7.3 system, mysql8.0.22 version, Dell G3 computer.

Is the mysql table name case-sensitive in linux? After mysql is installed, the table name is case-sensitive by default, and this property cannot be modified. The configuration of adding fields in /etc/mysql/my.cnf on the Internet will not take effect, and mysql will not start after modification.

Mysql table names are case-sensitive in linux, and mysql table names are case-insensitive in Windows. You can add a line of power _ case _ table _ names = parameter in the MySQL configuration file my.ini [mysqld] to set whether it is case-sensitive.

The case rules of MySQL database name, table name, column name and alias under Linux are as follows:

Database names and table names are strictly case-sensitive;

Aliases of tables are strictly case-sensitive;

Column names and column aliases are case-insensitive in all cases;

Variable names are also strictly case-sensitive;

MySQL is case-insensitive under Windows.

Therefore, in order to make programs and databases run normally in different operating systems, the best way is to convert them into lowercase when designing, but if the case has been standardized when designing, then just change the configuration of the database in Windows environment.

The specific operation is as follows:

Add a line of power _ case _ table _ names = 1 to my.ini [mysqld] in the MySQL configuration file.

Parameter interpretation:

0: Case sensitive

1: Case-insensitive

In MySQL, database and table pairs are just like directories and files in those directories.

Therefore, the sensitivity of the operating system determines the case sensitivity of database and table naming. This means that database and table names are case-insensitive in Windows, but case-sensitive in most types of Unix systems.

Column names and column aliases are case-insensitive in all cases, while table aliases are case-sensitive. To avoid this problem, you'd better use all lowercase letters and underscores when defining database naming rules, without using any uppercase letters. Or you can force it to start with the -O lower_case_table_names=1 parameter.

The content of this article about mysql table name area in linux is case-insensitive. Thank you for reading! I believe that everyone has a certain understanding of the case-insensitive knowledge of mysql table names in linux. If you want to learn more knowledge, please pay attention to Yisu Cloud Industry Information Channel.

Ask AI for details

Copyright Description:No reproduction without permission。

Knowledge sharing community for developers。

Let more developers benefit from it。

Help developers share knowledge through the Internet。

Follow us