Skip to content

Instantly share code, notes, and snippets.

@esdras
Created October 16, 2011 18:48
Show Gist options
  • Save esdras/1291259 to your computer and use it in GitHub Desktop.
Save esdras/1291259 to your computer and use it in GitHub Desktop.
MySQL charset operation
SELECT default_character_set_name FROM information_schema.SCHEMATA S WHERE schema_name = "schemaname";
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 = "schemaname" AND T.table_name = "tablename";
SELECT character_set_name FROM information_schema.`COLUMNS` C WHERE table_schema = "schemaname" AND table_name = "tablename" AND column_name = "columnname";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment