0

My system is Mountail Lion.

I want to change MySQL's default charset to utf8, so I copied my-huge.cnf in /usr/local/mysql/support-files to /etc/my.cnf and modified it.

However, strange things happen.

Before my copying, I can run mysql and there is mysql.sock in /tmp.

After my copying and restarting, the mysql.sock disappears so I cannot run.

I think the problem lies in my.cnf. Because whenever I remove it from /etc and restart, mysql.sock appears in /tmp and mysql can run. Whenever I copy it to /etc and restart, mysql.sock never appear.

==================== updated ====================

I found problem lies in the statement:

default-character-set = utf8

which I added in my.cnf under [mysqld]

when I detele it, mysql can restart and run.

==================== problem solved ====================

I should use

character-set-server = utf8

instead. ......I don't know why default-character-set = utf8 doesn't. Every tutorial on the internet uses it. =.=

4

0 回答 0