COLLATION_CHARACTER_SET_APPLICABILITY

COLLATION_CHARACTER_SET_APPLICABILITY 表将排序规则映射至适用的字符集名称。和 COLLATIONS 表一样,包含此表只是为了兼容 MySQL。

  1. USE INFORMATION_SCHEMA;
  2. DESC COLLATION_CHARACTER_SET_APPLICABILITY;

输出结果如下:

  1. +--------------------+-------------+------+------+---------+-------+
  2. | Field | Type | Null | Key | Default | Extra |
  3. +--------------------+-------------+------+------+---------+-------+
  4. | COLLATION_NAME | varchar(32) | NO | | NULL | |
  5. | CHARACTER_SET_NAME | varchar(32) | NO | | NULL | |
  6. +--------------------+-------------+------+------+---------+-------+
  7. 2 rows in set (0.00 sec)

查看 COLLATION_CHARACTER_SET_APPLICABILITY 表中 utf8mb4 字符集的排序规则映射:

  1. SELECT * FROM COLLATION_CHARACTER_SET_APPLICABILITY WHERE character_set_name='utf8mb4';

输出结果如下:

  1. +--------------------+--------------------+
  2. | COLLATION_NAME | CHARACTER_SET_NAME |
  3. +--------------------+--------------------+
  4. | utf8mb4_bin | utf8mb4 |
  5. | utf8mb4_general_ci | utf8mb4 |
  6. | utf8mb4_unicode_ci | utf8mb4 |
  7. +--------------------+--------------------+
  8. 3 rows in set (0.00 sec)

COLLATION_CHARACTER_SET_APPLICABILITY 表中列的含义如下:

  • COLLATION_NAME:排序规则名称
  • CHARACTER_SET_NAME:排序规则所属的字符集名称

另请参阅