Default to utf8 encoding for MySQL 5.5

Been banging my head several times trying to set the correct configuration for setting utf8 as default encoding for my MySQL database. Searching the web shows old configuration that is not compatible with MySQL 5.5. However, I’ve found one that really works with 5.5.

Simply insert the following line into /etc/my.cnf (or similar) under mysqld section.

[mysqld]
...
character-set-server = utf8

Then restart the mysqld daemon.

My specs: Slackware 14.0 beta (32 bit), MySQL 5.5, kernel 3.2.23 and PHP 5.4.x.

Enjoy and share.

This entry was posted in MySQL and tagged , , . Bookmark the permalink.

Random Posts

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>