information_schema系列之字符集校验(CHARACTER_SETS,COLLATIONS,COLLATION_CHARACTER_SET_APPLICABILITY)
蹉跎莫遣韶光老,人生唯有读书好。这篇文章主要讲述information_schema系列之字符集校验(CHARACTER_SETS,COLLATIONS,COLLATION_CHARACTER_SET_APPLICABILITY)相关的知识,希望能为你提供帮助。
1:CHARACTER_SETS
首先看一下查询前十条的结果:
文章图片
[email protected] [information_schema]> select * from CHARACTER_SETS order by MAXLEN DESC limit 10; +--------------------+----------------------+---------------------------------+--------+ | CHARACTER_SET_NAME | DEFAULT_COLLATE_NAME | DESCRIPTION | MAXLEN | +--------------------+----------------------+---------------------------------+--------+ | utf32 | utf32_general_ci | UTF-32 Unicode | 4 | | utf16le | utf16le_general_ci | UTF-16LE Unicode | 4 | | gb18030 | gb18030_chinese_ci | China National Standard GB18030 | 4 | | utf8mb4 | utf8mb4_general_ci | UTF-8 Unicode | 4 | | utf16 | utf16_general_ci | UTF-16 Unicode | 4 | | eucjpms | eucjpms_japanese_ci | UJIS for Windows Japanese | 3 | | ujis | ujis_japanese_ci | EUC-JP Japanese | 3 | | utf8 | utf8_general_ci | UTF-8 Unicode | 3 | | gbk | gbk_chinese_ci | GBK Simplified Chinese | 2 | | ucs2 | ucs2_general_ci | UCS-2 Unicode | 2 | +--------------------+----------------------+---------------------------------+--------+
文章图片
看一下官方给的解释:
INFORMATION_SCHEMA Name | SHOW Name | Remarks |
CHARACTER_SET_NAME | Charset字符集 | |
DEFAULT_COLLATE_NAME | Default collation默认排序 | |
DESCRIPTION | Description描述 | mysql extension |
MAXLEN | Maxlen最大长度,字节数 | MySQL extension |
文章图片
| CHARACTER_SETS | CREATE TEMPORARY TABLE `CHARACTER_SETS` ( `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT ‘‘, `DEFAULT_COLLATE_NAME` varchar(32) NOT NULL DEFAULT ‘‘, `DESCRIPTION` varchar(60) NOT NULL DEFAULT ‘‘, `MAXLEN` bigint(3) NOT NULL DEFAULT ‘0‘ ) ENGINE=MEMORY DEFAULT CHARSET=utf8 |
文章图片
【information_schema系列之字符集校验(CHARACTER_SETS,COLLATIONS,COLLATION_CHARACTER_SET_APPLICABILITY)】我们可以看到,ENGINE=MEMORY默认的引擎是memory的,也就是每次重启会重新生成一个一模一样的表
2:COLLATIONS 首先看一下查询前十条的结果:
文章图片
[email protected] [information_schema]> select * from COLLATIONS order by id limit 10; +-------------------+--------------------+----+------------+-------------+---------+ | COLLATION_NAME | CHARACTER_SET_NAME | ID | IS_DEFAULT | IS_COMPILED | SORTLEN | +-------------------+--------------------+----+------------+-------------+---------+ | big5_chinese_ci | big5 | 1 | Yes | Yes | 1 | | latin2_czech_cs | latin2 | 2 | | Yes | 4 | | dec8_swedish_ci | dec8 | 3 | Yes | Yes | 1 | | cp850_general_ci | cp850 | 4 | Yes | Yes | 1 | | latin1_german1_ci | latin1 | 5 | | Yes | 1 | | hp8_english_ci | hp8 | 6 | Yes | Yes | 1 | | koi8r_general_ci | koi8r | 7 | Yes | Yes | 1 | | latin1_swedish_ci | latin1 | 8 | Yes | Yes | 1 | | latin2_general_ci | latin2 | 9 | Yes | Yes | 1 | | swe7_swedish_ci | swe7 | 10 | Yes | Yes | 1 | +-------------------+--------------------+----+------------+-------------+---------+
文章图片
老规矩,贴一下官方解释:
INFORMATION_SCHEMA Name | SHOW Name | Remarks |
COLLATION_NAME | Collation 连线校对 | |
CHARACTER_SET_NAME | Charset对应的字符集 | MySQL extension |
ID | Id排序第几个,这个应该是MySQL自己编排的,不深究 | MySQL extension |
IS_DEFAULT | Default 表示的字符集是否被编译到服务器 |
MySQL extension |
IS_COMPILED | Compiled 涉及的存储器中的字符集表达的字符串进行排序所需的量。 |
MySQL extension |
SORTLEN | Sortlen 涉及的存储器中的字符集表达的字符串进行排序所需的量。 |
MySQL extension |
文章图片
------------------------------------------------------------------------------------------------------------+ | COLLATIONS | CREATE TEMPORARY TABLE `COLLATIONS` ( `COLLATION_NAME` varchar(32) NOT NULL DEFAULT ‘‘, `CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT ‘‘, `ID` bigint(11) NOT NULL DEFAULT ‘0‘, `IS_DEFAULT` varchar(3) NOT NULL DEFAULT ‘‘, `IS_COMPILED` varchar(3) NOT NULL DEFAULT ‘‘, `SORTLEN` bigint(3) NOT NULL DEFAULT ‘0‘ ) ENGINE=MEMORY DEFAULT CHARSET=utf8 | +------------+-------------------------------------------------------
文章图片
内存表,系统自动生成,不会改变。 3:COLLATION_CHARACTER_SET_APPLICABILITY 看一下前十条数据,我们根据条件查询一下。
文章图片
[email protected] [information_schema]> select * from COLLATION_CHARACTER_SET_APPLICABILITY where CHARACTER_SET_NAME like ‘%utf%‘ limit 10; +-------------------+--------------------+ | COLLATION_NAME | CHARACTER_SET_NAME | +-------------------+--------------------+ | utf8_general_ci | utf8 | | utf8_bin | utf8 | | utf8_unicode_ci | utf8 | | utf8_icelandic_ci | utf8 | | utf8_latvian_ci | utf8 | | utf8_romanian_ci | utf8 | | utf8_slovenian_ci | utf8 | | utf8_polish_ci | utf8 | | utf8_estonian_ci | utf8 | | utf8_spanish_ci | utf8 | +-------------------+--------------------+ 10 rows in set (0.00 sec)
文章图片
老规矩,贴一下官方解释:
INFORMATION_SCHEMA Name | SHOW Name | Remarks |
COLLATION_NAME | Collation | |
CHARACTER_SET_NAME | Charset |
推荐阅读
- CentOS7 安装虚拟环境 virtualenvwrapper
- Android-ContentProvider原理图
- android EditText自定义样式
- Unable to load script from assets 'index.android.bundle'.make sure you bundle is packaged co
- Android-ContentProvider简单的增删改查
- Android-ListView-SimpleCursorAdapter
- Apache httpd 2.4.4 rpm快速下载和安装
- 在Unix上安装Apache 2.4.6详细步骤
- 如何将子文件夹重定向到根文件夹()