MySQL Database Character Set

I have been working with MySQL databases, not exactly on a regular basis, for about 2 years now. This morning I was asked by a team member if the database she created was setup to use the UTF8 character set. The command to do this is shown below, but she had used a GUI and needed confirmation.

create database jiradb_363 default character set utf8;

I was aware when the database is backed up, the backup file contains the CREATE DATABASE statement. Since this was a newly created database, just execute mysqldump and look at the backup file. I also did some additional searching of the MySQL documentation and found I could easily query the information using the SHOW command below.

mysql> show create database jiradb_363;
+———————————–+—————————————————————————————————————–+
| Database   | Create Database                      |
+———————————–+—————————————————————————————————————–+
| jiradb_363 | CREATE DATABASE jiradb_363 40100
DEFAULT CHARACTER SET utf8                          |
+———————————–+—————————————————————————————————————–+
1 row in set (0.00 sec)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: