I wanted to setup MySQL to use utf-8 on the MAMP installation on my Mac.
I tried the instructions from this article: http://cameronyule.com/2008/07/configuring-mysql-to-use-utf-8/
However, I kept getting error messages that are similar to this one
[ERROR] /Applications/MAMP/Library/bin/mysqld: unknown variable 'default-collation=utf8_general_ci'
I did some search and realized that several variables are deprecated.
Reference: http://dev.mysql.com/doc/refman/5.1/en/server-options.html
Therefore, I added the following lines into /Applications/MAMP/conf/my.cnf
[mysql]
character-set-server=utf8
[client]
character-set-server=utf8
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
init-connect='SET NAMES utf8'
I restarted the server and mysql run successfully with relevant variables being set correctly.
In the "Variables" tab under phpMyAdmin interface (ex. http://localhost:8888/MAMP/?language=English)
character set client utf8
character set connection utf8
character set database utf8
character set filesystem binary
character set results utf8
character set server utf8
character set system utf8
collation connection utf8_general_ci
collation database utf8_general_ci
collation server utf8_general_ci
Character set related variables set to utf-8. |
Comments
IT contains just these lines
# The MySQL server
[mysqld]
skip-character-set-client-handshake
collation_server=utf8_unicode_ci
character_set_server=utf8
Hope this helps someone else