What is the character set and collation of that MySQL Database

It does not happen often, but every once in a while you are helping someone debug his code. You run across his Database and need to double check NOW how he created that thing.

To get this information you need to check:

USE db_name;

SELECT @@character_set_databse, @@collation_database;

Alternatively, to display the values without changing the default database:

SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME

FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = ‚db_name‘;

Straight from the MySQL Docu: https://dev.mysql.com/doc/refman/5.5/en/charset-database.html