MySQL Set Default Character Set and Collation

I am getting fed up with all the databases on my server being set to latin1 with a Swedish collation, I guess I am just being anal, anyhow. I found out how to configure MySQL so that it always uses utf8. Add the following lines to your /etc/mysql/my.cnf under the mysqld section:

init-connect='SET NAMES utf8'
default-character-set=utf8
default-collation=utf8_unicode_ci
character-set-server=utf8

About Chris

Twenty-something year old computer science graduate living in the West Midlands, working as a PHP software developer for a local company.
This entry was posted in Linux, Network, Technology, sandman. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>