Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My mysql server's current server character set is latin1. My server is started on startup via rc.conf setting mysql_enable="YES". How to set my server to use utf8 as the server character set?

share|improve this question

I edited /etc/rc.conf and added the mysql_args line below:


This works and I can see the server character set is updated.

share|improve this answer
I'd prefer a config file based solution but this is working for now – User Sep 8 '12 at 3:02

From the manual,

Specify character settings at server startup. To select a character set and collation at server startup, use the --character-set-server and --collation-server options.

You include the following in /usr/local/etc/my.cnf


(You could find samples of my.cnf in /usr/local/share/mysql)

More information on mysql

share|improve this answer
/etc/mysql doesn't exist on FreeBSD – User Sep 8 '12 at 2:43
@User that's a mistake, sorry. answer updated – warl0ck Sep 8 '12 at 2:55
I'm trying this but for some reason mysql doesn't want to start when the file is there. If I rename the file then mysql starts fine. – User Sep 8 '12 at 3:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.