MySQL

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.

Leave a reply

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