MySQL Utf-8 Charset Problem


#1

In my previous webserver, they actually used the oldest version which is MySQL 4.0.25-standard. I’ve tried to export the database from my previous webserver and import them to dreamhost, but I found all character show errors in dreamhost.

I’ve no idea with that, my setting in MySQL of my previous webserver is:
Language: zhtw-utf8 (Traditional chinese)

And now I find there are 3 different charset setting in MySQL of dreamhost: Language, MySQL Charset & MySQL connection collation. What actually should i set in MySQL of dreamhost?

I tried to set the MySQL charset as UTF-8 Unicode (utf8), & MySQL connection collation as utf8-general-ci, but all characters showed error. Please help and I am not sure what’s the problem is.

Anyone can help to figure out this problem? Thank you so much!!


#2

You need to add full support to mysql_full_unicode_support

Edit the my.cnf file:

[client]
default-character-set = utf8mb4

[mysqld]
innodb_file_format = Barracuda
innodb_file_per_table = 1
innodb_large_prefix

character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
skip-character-set-client-handshake

[mysql]
default-character-set = utf8mb4

I don`t know how one would do this here in Dreamhost, though…