mysql查看不同级别的字符集

库的字符集:

SELECT default_character_set_name FROM information_schema.SCHEMATA S
WHERE schema_name = 'test';

 

表的字符集:

SELECT CCSA.character_set_name FROM information_schema.`TABLES` T,
information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` CCSA
WHERE CCSA.collation_name = T.table_collation
AND T.table_schema = 'test'
AND T.table_name = 't1';

列的字符集:
SELECT character_set_name FROM information_schema.`COLUMNS` C
WHERE table_schema = 'test'
AND table_name = 't1'
AND column_name = 'name';

posted @ 2017-12-19 20:03  泽锦  阅读(371)  评论(0编辑  收藏  举报