In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces how to set the mysql table name is case-insensitive, the article is very detailed, has a certain reference value, interested friends must read it!
Methods: 1, log in using root and open the "/ etc/my.cnf" file; 2, add "lower_case_table_names=1" under the "mysqld" node in the file; 3, restart the mysql service with the "service mysqld restart" command.
The operating environment of this tutorial: linux7.3 system, mysql8.0.22 version, Dell G3 computer.
How mysql sets table names case-insensitive
In linux, mysql is case-sensitive, while in Windows, mysql is case-insensitive.
Therefore, the following solution is based on the linux system.
After logging in with your root account, add lower_case_table_names=1 after "mysqld] in / etc/my.cnf, and restart the MYSQL service. At this time, the setting is successful: table names are not case-sensitive.
Detailed description of lower_case_table_names parameters:
Lower_case_table_names = 0
Where 0: case sensitive, 1: case insensitive
The MySQL database name, table name, column name and alias case rules under Linux are as follows:
1. Database names and table names are strictly case-sensitive
2. Aliases for tables are strictly case-sensitive
3. Column names and column aliases ignore case in all cases
4. Variable names are also strictly case-sensitive
MySQL is not case-sensitive under Windows.
3. If you want to distinguish the case of field values when querying, you need to set the BINARY attribute for field values, which can be set in a variety of ways:
A. Set at creation time:
CREATE TABLE T (
A VARCHAR (10) BINARY); B, modify using alter
The above is all the content of the article "how mysql sets table names to be case-insensitive". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.