当前位置:网站首页>十五. 实战——mysql建库建表 字符集 和 排序规则
十五. 实战——mysql建库建表 字符集 和 排序规则
2022-08-05 03:07:00 【这不比博人传燃?】
1. 字符集和排序规则
字符集
当数据库需要适应不同的语言就需要有不同的字符集,如果不指定字符集的话,那么就会使用数据库的默认的字符集,每种字符集都有自己默认的排序规则。mysql默认字符集为utf8,默认排序规则为utf8_general_ci。一般我们也会选择字符集为utf-8
排序规则
每一种字符集都会有自己的排序规则(collation),排序规则后缀一般分为cs, ci
- cs: case sensitive 翻译过来就是对大小写敏感
- ci: case insensitive 翻译过来就是对大小写不敏感
举例:
select * from test where column1 like "A%"
如果我们选择cs,这时就会选择A开头的
如果我们选择ci,这时就会选择a或者A开头的
在不确定大小写的情况,我们通常选择ci,要求不敏感,可以选择的范围多一点
原文:https://blog.csdn.net/aduoge/article/details/116501560
2. utf8和utf8mb4的区别:
MySQL在5.5.3之后增加了这个utf8mb4的编码,utf8mb4完全向下兼容utf8,为了节省空间,一般情况下使用utf8也就够了。
原文:https://www.fujieace.com/mysql/utf8-utf8mb4.html
边栏推荐
- undo问题
- Open Source License Description LGPL
- 2022-08-04 第六小组 瞒春 学习笔记
- 剑指Offer--找出数组中重复的数字(三种解法)
- QT MV\MVC结构
- [Qixi Festival] Romantic Tanabata, code teaser.Turn love into a gorgeous three-dimensional scene and surprise her (him)!(send code)
- torch.roll()
- 【 genius_platform software platform development 】 : seventy-six vs the preprocessor definitions written cow force!!!!!!!!!!(in the other groups conding personnel told so cow force configuration to can
- 使用二维码传输文件的小工具 - QFileTrans 1.2.0.1
- Chinese characters to Pinyin
猜你喜欢
随机推荐
Snapback - same tree
为什么pca分量没有关联
Dynamic management of massive service instances
word column notes
torch.roll()
The pit of std::string::find return value
链表的简单描述及代码的简单实现
【软件测试】自动化测试之unittest框架
(11) Metaclass
How OpenGL works
1527. Patients suffering from a disease
The problem of lack of dynamic library "libtinfo.so.5" in ksql application under UOS system
ASP.NET应用程序--Hello World
通过模拟Vite一起深入其工作原理
Beyond YOLO5-Face | YOLO-FaceV2 officially open source Trick+ academic point full
Simple description of linked list and simple implementation of code
Gantt chart is here, project management artifact, template is used directly
Data to enhance Mixup principle and code reading
HDU 1114:Piggy-Bank ← 完全背包问题
Syntax basics (variables, input and output, expressions and sequential statements)









