当前位置:网站首页>十五. 实战——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
边栏推荐
- In 2022, you still can't "low code"?Data science can also play with Low-Code!
- Syntax basics (variables, input and output, expressions and sequential statement completion)
- 2022-08-04 第六小组 瞒春 学习笔记
- Syntax basics (variables, input and output, expressions and sequential statements)
- QT语言文件制作
- The 22-07-31 weeks summary
- Study Notes-----Left-biased Tree
- Intersection of Boolean Operations in SuperMap iDesktop.Net - Repairing Complex Models with Topological Errors
- Step by step how to perform data risk assessment
- 【Daily Training】1403. Minimum Subsequence in Non-Increasing Order
猜你喜欢
After the large pixel panorama is completed, what are the promotion methods?
How to sort multiple fields and multiple values in sql statement
QT语言文件制作
Matlab画图3
The usage of try...catch and finally in js
ASP.NET application--Hello World
Beidou no. 3 short message terminal high slope in open-pit mine monitoring programme
2022高处安装、维护、拆除考试题模拟考试题库及在线模拟考试
如何在WordPress中添加特定类别的小工具
mysql没法Execute 大拿们求解
随机推荐
HDU 1114: Piggy-Bank ← The Complete Knapsack Problem
undo问题
Cybersecurity and the Metaverse: Identifying Weak Links
The linear table lookup
Physical backup issues caused by soft links
Use @Mapper to query the partition status of oracle and report an error
627. Change of gender
金仓数据库如何验证安装文件平台正确性
Distributed systems revisited: there will never be a perfect consistency scheme...
Beidou no. 3 short message terminal high slope in open-pit mine monitoring programme
[Fortune-telling-60]: "The Soldier, the Tricky Way"-2-Interpretation of Sun Tzu's Art of War
[Solved] Unity Coroutine coroutine is not executed effectively
.NET Application -- Helloworld (C#)
Principle and Technology of Virtual Memory
云原生(三十二) | Kubernetes篇之平台存储系统介绍
开源协议说明LGPL
CPDA|How Operators Learn Data Analysis (SQL) from Negative Foundations
1667. 修复表中的名字
Question about #sql shell#, how to solve it?
高项 02 信息系统项目管理基础