Michal M
Michal M

Reputation: 9480

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, probably 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.

Upvotes: 1

Views: 1533

Answers (2)

Harald
Harald

Reputation: 131

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

Upvotes: 2

Michal M
Michal M

Reputation: 9480

This website below explains is quite well.

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

Upvotes: 1

Related Questions