Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of setting lower_case_table_names parameters in MySQL

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the method of setting lower_case_table_names parameters in MySQL, the content of the article is carefully selected and edited by the author, has a certain pertinence, and is of great significance to everyone's reference, the following is to understand the method of setting lower_case_table_names parameters in MySQL with the author.

Summary: lower_case_table_names is a parameter that determines whether the mysql setting is case-sensitive.

1. Parameter description:

Lower_case_table_names=0 table names are stored as given sizes and comparisons are case-sensitive

Lower_case_table_names = 1 table names are stored in lowercase on disk, but are case-insensitive when compared

The lower_case_table_names=2 table name is stored in the given case but is compared in lowercase

The default value of lower_case_table_names under unix,linux is 0. The default value of Windows is 1. The default value of Mac OS X is 2.

two。 View method: # go to the mysql command line and execute any of the following statements to view: show variables like 'lower_case_table_names';select @ @ lower_case_table_names;3. Change method:

Change the database parameter file my.cnf

Add or modify lower_case_table_names = 1 under mysqld

Then restart the database

4. Matters needing attention in reality modification:

Since most initializations of MySQL installed on Linux systems adopt the default lower_case_table_ namespace value, that is, case-sensitive, it may result in the case of the same instance with both uppercase and lowercase database tables, so you should pay attention to case when calling.

At this point, the change steps are as follows:

1. Whether there are uppercase libraries and tables in the verified examples

two。 Change uppercase library name and table name to lowercase

For more information on changing the library name, please see: https://www.cnblogs.com/gomysql/p/3584881.html

Change the table name: rename table TEST_TB to test_tb

3. Set lower_case_table_names = 1

4. Restart the database

After reading the above methods of setting lower_case_table_names parameters in MySQL, many readers must have some understanding. If you need to get more industry knowledge and information, you can continue to follow our industry information column.

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.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report