MySQL: How to Show the Collation and Character Set of a MySQL Database CodeUnit 25 MAR 2011

To find out what collation and character set your database is using turns out to be pretty trivial thanks to MySQL’s SHOW VARIABLES SQL statement that reveals all the inner workings of your setup.

First, select your database. If you are working from the command line:

USE mydatabase

Then, run the SHOW VARIABLES statement against your database, using a LIKE conditional to narrow down to what we want to see:

SHOW VARIABLES LIKE 'character_set_database'
SHOW VARIABLES LIKE 'collation_database'

These two statements will return the corresponding values that you are interested in.

If you want to see even more of the settings on your database, just run:

SHOW VARIABLES

Nifty.

Related Posts:

About Craig Lotter

Software developer, husband and dad to two little girls. Writer behind An Exploring South African. I don't have time for myself any more.