MySQL: How to change default Character set to UTF-8

In the previous post, I have discussed and provided small note on Database Character Set and Collation.
In this post, I show you that how you can configure or change default Character Set in MySQL.

Sometimes it is required to change the default character set of MySQL Server or MySQL Database.
A Character set “latin1” and Collation “latin1_swedish_ci” are the default of MySQL Server.
This is standard configuration and you do not need to change anything but if your application requires to store data using a different character set, you have to change this default configuration.

Here, I am showing to change your default character set and collation to UTF-8.

MySQL Server provides, different three ways to configure character set and collation.

  • Configure Character set and Collation at Database Level.
  • Configure Character set and Collation at Server Startup.
  • Configure Character set and Collation during MySQL Server Installation and Configuration.

First, check your default Character Set and Collation of MySQL Server.

If you want to change default to UTF-8, you want to add the following to my.cnf (MySQL Configuration File).

Specify Character Settings per Database:

Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from

Leave a Reply

4 Comments on "MySQL: How to change default Character set to UTF-8"

Notify of

Sort by:   newest | oldest | most voted
11 months 6 days ago

When someone writes an paragraph he/she maintains the image of
a user in his/her brain that how a user can know it.

So that’s why this piece of writing is great. Thanks!

9 months 21 days ago

I was examining some of your blog posts on this site and I think this internet site is rattling instructive! Continue posting.

9 months 6 days ago

I do agree with all of the ideas you have presented in your post. They’re very convincing and will definitely work. Still, the posts are very short for newbies. Could you please extend them a little from next time? Thanks for the post.

9 months 2 days ago

Wow, incredible blog layout! How long have you been blogging for?
you make blogging look easy. The overall look of your web site is
excellent, let alone the content!