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

What is the impact of mysql database case?

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

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "mysql database case has what effect," interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "what is the impact of mysql database case"!

What are the effects of mysql database case?

Note: Although database and table names are case-insensitive in Windows, you should not use different case numbers to refer to a given database and table in the same query. The following query will not work because it references a table with my_table and MY_TABLE:

mysql>SELECT*FROMmy_tableWHEREMY_TABLE.col=1;

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

Table aliases are case-sensitive. The following query will not work because it references aliases with a and A:

mysql>SELECTcol_nameFROMtbl_nameASaWHEREa.col_name=1ORA.col_name=2;

If you have trouble remembering the upper and lower case of database and table names, it is recommended that you adopt a consistent convention, such as always creating databases and tables in lowercase letters.

What are the effects of mysql database case?

Another way to avoid this problem is to start mysqld with-Olower_case_table_names=1. By default this option is 1 in Windows and 0 in Unix.

If lower_case_table_names is 1, MySQL will convert all table names to lowercase word lines during store and lookup. (Starting with MySQL 4.0.2, this option also applies to database names.) Note that when you change this option, you must first convert the old table names to lowercase letters before launching mysqld.

$pwd

/data1/etl/aiinsight/ScheduleServer/mysql/support-files

$./ mysql.serverstop

$pwd

/data1/etl/aiinsight/ScheduleServer/mysql/bin

./ mysqld_safe--lower_case_table_names

Method 2: Modify the my.cnf profile

Add under [mysqld]

lower_case_table_names=1

At this point, I believe that everyone has a deeper understanding of "mysql database case has what impact," may wish to actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

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

Database

Wechat

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

12
Report