information_schema.collation_character_set_applicability 学习

时间:2022-09-15 20:48:32

字符集和排序规则之间是不可以随便搭配的、如果你想知道一个字符集它所搭配的排序规则有哪些?那就可以从information_schema.collation_character_set_applicability

这个表来看

1、information_schema.collation_character_set_applicability 常用列说明:

  1、character_set_name                :字符集名

  2、collation_name                    :排序规则名

2、例子:

测试字符集和与之匹配的排序规则

select
character_set_name,collation_name
from
information_schema.collation_character_set_applicability
order by
character_set_name; +--------------------+--------------------------+
| character_set_name | collation_name |
+--------------------+--------------------------+
| armscii8 | armscii8_bin |
| armscii8 | armscii8_general_ci |
| ascii | ascii_bin |
| ascii | ascii_general_ci |
| big5 | big5_bin |
| big5 | big5_chinese_ci |
| binary | binary |
| cp1250 | cp1250_polish_ci |
| cp1250 | cp1250_bin |
| cp1250 | cp1250_croatian_ci |
| cp1250 | cp1250_czech_cs |
| cp1250 | cp1250_general_ci |