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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.