当前位置:网站首页>MySQL view character set and proofing rules
MySQL view character set and proofing rules
2022-04-22 04:55:00 【Liang Yunliang】
About SQL Keywords and function names are not case sensitive , But whether the data value is case sensitive , And character sets and proofreading rules .
_ci( Case insensitive ),_cs( Case sensitive ),_bin( binary , That is, the comparison is based on the value of character encoding and language irrelevant )
- View all character sets and proofreading rules

- see GBK and UTF-8 Proofreading rules for character sets
show collation like ‘gbk%’;

show collation like ‘utf8%’;

- utf8_unicode_ci and utf8_general_ci Alignment 、 There is no real difference in English .
- utf8_general_ci Fast proofreading , But the accuracy is a little bit poor .
- utf8_unicode_ci High accuracy , But proofreading is a little slow .
If your application has German 、 French or Russian , Be sure to use utf8_unicode_ci. It's usually used utf8_general_ci That's enough .
- View the server's character set and proofreading rules

- View and modify the character set and proofreading rules of a database

or

Modify the character set and proofreading rules of the database :
ALTER DATABASE Database name DEFAULT CHARACTER SET Character set name 【COLLATE Name of proofreading rule 】;
for example :
ALTER DATABASE ceshi_db DEFAULT CHARACTER SET utf8 collate utf8_general_ci;

Be careful : After modifying the default character set and proofreading rules of the database , The character set and proofreading rules of the original created table will not change , if necessary , Then it needs to be modified separately .
- View the character set and proofreading rules of a table
View character set :show create table users;

If you want to see proofreading rules :show table status from bookstore like ‘%users%’ ;

Modify the character set and proofreading rules of a table :
Modify the default character set of the table :
ALTER TABLE The name of the table DEFAULT CHARACTER SET Character set name 【COLLATE Name of proofreading rule 】;
Set the default character set and all character columns (CHAR,VARCHAR,TEXT) Change to a new character set :
ALTER TABLE The name of the table CONVERT TO CHARACTER SET Character set name 【COLLATE Name of proofreading rule 】;
for example :ALTER TABLE ceshi_table DEFAULT CHARACTER SET gbk collate gbk_chinese_ci;
版权声明
本文为[Liang Yunliang]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210738413938.html
边栏推荐
- Leetcode refers to offer 68 - I. the nearest common ancestor of the binary search tree
- Chapter V function
- bugly使用记录
- 2022g2 boiler operator certificate examination question bank and online simulation examination
- Extraction de la fonction Speech de l'ensemble de données emo - DB
- 2022t elevator repair test exercises and online simulation test
- [stack and queue] simple application of C language ⌊ stack and queue realize each other, circular queue ⌉
- PHP quickly raises a value in a two-dimensional array to an array key value, array_ The wonderful use of column
- Opencv usage record of neural network learning
- Small bug -- hidden problem of Guide Package
猜你喜欢

【板栗糖GIS】arcmap—模型构造器—批量裁剪栅格数据

Application of an open current transformer with switching value

Calculator (force buckle)

Discussion on data set division

vue项目 npm run build 打包项目时为css、js文件加时间戳版本号,防止浏览器缓存

JS Chapter 12
![[selenium] basic application of unittest testing framework](/img/17/b3d25b9eebccab37128e08bab4bd66.png)
[selenium] basic application of unittest testing framework

【Selenium】Yaml数据驱动

Logistic regression -- case: cancer classification and prediction
Apple plans to expand children's information and communication security features to the UK and Canada
随机推荐
[chestnut sugar GIS] ArcMap - Model Builder - batch clipping grid data
不同品牌设备如何兼容实现互联?一文教你看懂
EMO-DB 數據集的 Speech 特征提取
[selenium] basic application of unittest testing framework
Rookie's counter attack
Application of an open current transformer with switching value
Chapter 2 MySQL data types and operators
C-handwritten 10
Spark 入门程序 : WordCount
C language simple [stack and queue] (bracket matching problem)
2022t elevator repair test questions and online simulation test
cv2. drawContours()、cv2. findContours()、cv2. Usage analysis of boundingrect (IMG) function
Extraction de la fonction Speech de l'ensemble de données emo - DB
2022g2 power station boiler stoker examination exercises and online simulation examination
How to get the creator and other information of PNG pictures, not just the file size and other information That is, how to obtain the metadata of the picture
The simulation generates random numbers and calculates the birthday of each student
Apple plans to expand children's information and communication security features to the UK and Canada
【图像分割综述】Image Segmentation Using Deep Learning: A Survey
Leetcode sword finger offer 22 The penultimate node in the linked list
Boyun beyondcmp cloud management platform version 5.6 release