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

I have two mysql servers, viewed from the same mysql client, right_server is rendering the french characters correctly, wrong_server is not. Encoding is the same :

$ mysql -h right_server -NBe "SHOW VARIABLES LIKE 'character_set_%'"
$ mysql -h wrong_server -NBe "SHOW VARIABLES LIKE 'character_set_%'"

give same results :

character_set_client     utf8
character_set_connection utf8
character_set_database   utf8
character_set_filesystem binary
character_set_results    utf8
character_set_server     utf8
character_set_system     utf8

I use mysqldump to check tables structures are the same :

$ mysqldump -h right_server db MY_TABLE | grep MY_COL
$ mysqldump -h wrong_server db MY_TABLE | grep MY_COL

but one of the comment is not rendered correctly :

  `MY_COL` varchar(7) COLLATE utf8_bin COMMENT 'associé à',
  `MY_COL` varchar(7) COLLATE utf8_bin COMMENT 'associ. .',

(result with mysqldump --default-character-set=UTF8 --no-data is the same)

In wrong_server characters seem correctly stored :

[wrong_server]$ mysql -e 'show create table db.MY_TABLE\G'
  `MY_COL` varchar(7) COLLATE utf8_bin COMMENT 'associé à',

How to force mysqldump encoding ?

Note: the only difference I see between servers is

character_sets_dir      /.../mysql.../share/charsets/

in SHOW VARIABLES LIKE 'character_set_%' of one server and no utf file defined in this directory.

share|improve this question

Your Answer


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

Browse other questions tagged or ask your own question.