728x90
MySQL에서 DB의 Character Set을 확인하기 위해 다음과 같이 할 수 있다.
SELECT default_character_set_name FROM information_schema.SCHEMATA S
WHERE schema_name = "db_ctb";
테이블의 Character Set을 확인하기 위해 다음과 같이 할 수 있다.
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 = "db_ctb"
AND T.table_name = "tb_chat_message";
컬럼의 Character Set을 확인하기 위해 다음과 같이 할 수 있다.
SELECT character_set_name FROM information_schema.`COLUMNS` C
WHERE table_schema = "db_ctb"
AND table_name = "tb_chat_message"
AND column_name = "message";