After digging around for a afternoon, this is how to fix it:
vi /etc/my.cnf
And add those lines to the config:
init_connect='SET collation_connection = utf8_general_ci'
init_connect='SET NAMES utf8'
default-character-set=utf8
character-set-server=utf8
collation-server=utf8_general_ci
skip-character-set-client-handshake
There are other options for collation besides utf8_general_ci such as utf8_unicode_ci. See this article:
http://dev.mysql.com/doc/refman/5.1/en/charset-unicode-sets.html
Reference: http://rhyous.com/2009/11/05/how-to-create-a-utf-8-unicode-database-on-mysql/
沒有留言:
張貼留言