当前位置:网站首页>How to make MySQL case insensitive

How to make MySQL case insensitive

2022-06-21 07:31:00 Yisu cloud

How to make mysql Case insensitive

Today, I will share with you how to make mysql Case insensitive related knowledge points , Detailed content , Clear logic , I believe most people still know too much about this knowledge , So share this article for your reference , I hope you will gain something after reading this article , Now let's take a look .

Give Way mysql Case insensitive method :1、 Get into mysql Installation directory , Find and open the configuration file “my.ini”;2、 Add... To the last line of the configuration file “lower_case_table_names=1” sentence , Set case sensitive parameters “lower_case_table_names”, Give Way mysql Case insensitive ;3、 restart mysql The service can be .

The operating environment of this tutorial :windows7 System 、mysql8 edition 、Dell G3 The computer .

Give Way mysql Case insensitive method

mysql Case sensitive configuration is related to two parameters —— lower_case_file_system and lower_case_table_names

  • lower_case_file_system: Indicates whether the current system file is case sensitive (ON Is not sensitive ,OFF For sensitive ), Read only parameters , Can't modify .

  • lower_case_table_names: Indicates whether the table name is case sensitive , You can modify .

lower_case_file_system Parameter cannot be modified , So we can only use lower_case_table_names Parameters to make mysql Case insensitive .

step :

1、 Get into mysql Installation directory , Find and open the configuration file my.ini

 How to make mysql Case insensitive

2、 Add the following sentence to the last line of the configuration file

lower_case_table_names=1

lower_case_file_system Indicates whether the file system where the data directory is located is sensitive to the case of the file name

  • 0: Case sensitive

  • 1: Case insensitive

 How to make mysql Case insensitive

3、 restart mysql The service can be .

matters needing attention :

Default lower_case_tables_name by 0 Set to 1, You need to convert the existing library table name to lowercase :

1) For the case where only uppercase letters exist in the table name :

①、lower_case_tables_name=0 when , perform rename table In lowercase .

②、 Set up lower_case_tables_name=1, Restart and take effect .

2) Case where the library name exists :

①、lower_case_tables_name=0 when , Use mysqldump export , And delete the old database .

②、 Set up lower_case_tables_name=1, Restart and take effect .

③、 Import data to instance , At this point, the library name containing uppercase letters has been converted to lowercase .

That's all “ How to make mysql Case insensitive ” All the content of this article , Thank you for reading ! I believe you will gain a lot after reading this article , Xiaobian will update different knowledge for you every day , If you want to learn more , Please pay attention to the Yisu cloud industry information channel .

原网站

版权声明
本文为[Yisu cloud]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/172/202206210727174142.html