Read more

MySQL Server and UTF-8 Defaults

Martin Straub
August 25, 2010Software engineer at makandra GmbH

Unless all MySQL server defaults are set to UTF-8, mysqldump encodes UTF-8 characters incorrectly and only outputs correct UTF-8 when you switch to Latin 1 (!). Also you need to setup charset and collation manually for each new database.

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

To prevent this, make sure your /etc/mysql/my.cnf looks like this:

[mysqld]
default-character-set = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set=utf8mb4

After that do

sudo /etc/init.d/mysql restart
Posted by Martin Straub to makandra dev (2010-08-25 16:33)