View the Character Sets of MySQL Schemas, Tables or Columns
Schemas
SELECT default_character_set_name FROM information_schema.SCHEMATA S WHERE schema_name = "<schema_name>";
Tables
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 = "<schema_name>"
AND T.table_name = "<table_name>";
Columns
SELECT character_set_name FROM information_schema.`COLUMNS` C
WHERE
table_schema = "<schema_name>"
AND table_name = "<table_name>"
AND column_name = "<column_name>";
Written by Bui The Hoa
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Mysql
Authors
Related Tags
#mysql
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#