Server Fault is a question and answer site for system and network administrators. 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

Our whole application is now able to handle UTF-8 and it will be our choice in terms of encoding all across our architecture. The last step is to change the encoding of our MySQL databases.

Of course, ALTER TABLE db_table CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; should be able to convert each of the tables to the right UTF8 encoding, yet, is there anything else I should do? I believe that the my.cnf configuration file needs to be changed as well.

share|improve this question
Shouldn't you be enjoying Christmas Day, instead of posting here? – Tom O'Connor Dec 25 '10 at 15:22
Shouldn't you be enjoying Xmas, instead of commenting? :D Not everyone celebrates Xmas! – Julien Genestoux Dec 25 '10 at 21:46
I don't enjoy christmas. My iphone's decided to break finally today. Best Xmas Ever (!) – Tom O'Connor Dec 25 '10 at 21:49
up vote 2 down vote accepted

Copy and paste this into a terminal and restart the Mysql server to change the default character encoding.

cat << EOF > /etc/mysql/conf.d/utf8.cnf



share|improve this answer
ha, thx... that's a good one. – Julien Genestoux Dec 25 '10 at 21:47

You should also set the character-set from your client application by these sql statements:

SET character_set_client = utf8;
SET character_set_results = utf8;
SET character_set_connection = utf8;
share|improve this answer

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.