2. CHARACTER_SETS

2. CHARACTER_SETS

CHARACTER_SETS表提供有关可用字符集的信息。 下表中的SHOW Name值对应于SHOW CHARACTER SET语句的列名。

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包含以下列:

  • CHARACTER_SET_NAME:字符集名称
  • DEFAULT_COLLATE_NAME:字符集默认排序规则
  • DESCRIPTION:字符集的描述
  • MAXLEN:存储一个字符所需的最大字节数。

示例

mysql> SELECT * FROM INFORMATION_SCHEMA.CHARACTER_SETS WHERE CHARACTER_SET_NAME LIKE 'utf8';
+--------------------+----------------------+---------------+--------+
| CHARACTER_SET_NAME | DEFAULT_COLLATE_NAME | DESCRIPTION   | MAXLEN |
+--------------------+----------------------+---------------+--------+
| utf8               | utf8_general_ci      | UTF-8 Unicode |      3 |
+--------------------+----------------------+---------------+--------+
1 row in set (0.00 sec)


mysql> show character set like 'utf8';
+---------+---------------+-------------------+--------+
| Charset | Description   | Default collation | Maxlen |
+---------+---------------+-------------------+--------+
| utf8    | UTF-8 Unicode | utf8_general_ci   |      3 |
+---------+---------------+-------------------+--------+
1 row in set (0.00 sec)
posted @ 2018-08-19 11:35  DB-Engineer  阅读(111)  评论(0编辑  收藏  举报