Skip to content

Instantly share code, notes, and snippets.

@cliffordp
Last active August 26, 2016 16:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save cliffordp/ee49abbf6eb79ccb73bd4251b5e20878 to your computer and use it in GitHub Desktop.
get a WordPress site's database collation
/**
* By Barry 2016-08-26
*
* Get a WordPress site's database collation
*
* NOTE: MUST change "tribeDBftict" to your own database name
* NOTE: MAY NEED TO change "wp_" if you have a custom database prefix
*
* It should result like this in PHPMyAdmin: https://cl.ly/3V0O3x0B1B1R
*/
SELECT char_set.character_set_name
FROM information_schema.`TABLES` table_data,
information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` char_set
WHERE char_set.collation_name = table_data.table_collation
AND table_data.table_schema = "tribeDBftict" -- change to your own database name
AND table_data.table_name = "wp_postmeta"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment