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

Example Analysis of case-insensitive processing of MySQL Database tables

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

Share

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

This article shows you an example analysis of the case-insensitive processing of MySQL database tables, which is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

Case-sensitive control of MySQL

Mysql controls case sensitivity through the lower_case_table_names parameter.

1: parameter meaning

Lower_case_table_names: this parameter cannot be modified dynamically, and the database must be restarted.

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

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

Lower_case_table_names=2, the table name is stored in the given case but compared in lowercase

2 case-sensitive rules

Under linux:

Database names and table names are strictly case-sensitive

Aliases for tables are strictly case sensitive

Column names and column aliases are case ignored in all cases

Variable names are also strictly case-sensitive

Under windows:

Are not case-sensitive.

Under Mac OS (non-UFS volume):

Are not case-sensitive.

Case list:

Edu_website_ images table exists in the database

Select * from edu_website_images

The error does not exist through uppercase query.

Select * from EDU_WEBSITE_IMAGES

How to deal with it?

Configure mysql Profil

Vi / etc/my.cnf join a line lower_case_table_names = 1

/ / restart mysqlservice mysql restart

And then

Show variables like'% lower%'

It is possible that it turns out that the above has not been changed.

Let's export the database and recreate the database and the result will be correct.

The above is an example analysis of the case-insensitive processing of MySQL database tables. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are 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.

Share To

Database

Wechat

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

12
Report