开发者

MySQL default charset and collation

I am installing MySQL server on FreeBSD. My current port version is 5.5.15 on FreeBSD 7.2.

I am wondering how to get it installed with different than latin1 default charset and collation.

Currently when I install it with default Makefile I get this:

| character_set_client     | latin1
| character_set_connection | latin1
| character_set_database   | latin1
| character_set_filesystem | binary
| character_set_results    | latin1
| character_set_server     | latin1
| character_set_system     | latin1
| character_sets_dir       | /usr/local/share/mysql/charsets/
| collation_connection     | latin1_swedish_ci
| collation_database       | latin1_swedish_ci
| collation_server         | latin1_swedish_ci

I can't understand why latin1 is the default charset in the first place, but well, 开发者_如何学JAVAprobably not the best place to discuss it.

Anyway... I'd like to change the default charsets to utf8 and collation to utf8_unicode_ci.

I tried changing Makefile and added following lines to CMAKE_ARGS:

-DWITH_CHARSET="utf8" \
-DWITH_COLLATION="utf8_unicode_ci"

All that got changed was character_set_system to utf8.

How do I change all of those? Could be a compilation param (preferrably) or my.cnf setting.

Will appreciate any help.


Go ahead and install with the wrong defaults, and later change the settings when creating a /etc/my.cnf file.

[mysqld]
collation_server = utf8_general_ci
character_set_server = utf8


This website below explains is quite well.

http://rentzsch.tumblr.com/post/9133498042/howto-use-utf-8-throughout-your-web-stack

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜