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

FreeBSD Server with Mysql and make.conf like that

.if ${.CURDIR} == ${PORTSDIR}/databases/mysql50-server
.if ${.CURDIR} == ${PORTSDIR}/databases/mysql50-client

I have mysql table with such structure

mysql> show create table phpbb_bt_torrents\G
*************************** 1. row ***************************
       Table: phpbb_bt_torrents
Create Table: CREATE TABLE `phpbb_bt_torrents` (
`info_hash` char(20) CHARACTER SET cp1251 COLLATE cp1251_bin NOT NULL DEFAULT '',

I'm backing it up at night with mysqldump --quote-names --add-drop-table db>db.sql

If I restore backup using mysql < db.sql on the same server then I'm getting not quite the same data, for example:

SELECT hex(info_hash) FROM phpbb_bt_torrents

8CB0701A0C8B7D976538**88**E8B959A6420AEC7679 becomes 8CB0701A0C8B7D976538**3F**E8B959A6420AEC7679 after restore

A9**98**6D2E961E1F407E74E9D18D811DDB702924F5 becomes A9**3F**6D2E961E1F407E74E9D18D811DDB702924F5 after restore

and so on... i've noticed only 88h and 98h characters corrupts, but there can be more.

Is there a way to backup-restore data without corruption?

share|improve this question

Can you try dumping with "mysqldump --opt ..." and then restoring it?

It shouldn't make a difference when on the same server, just to make sure this cannot be some user-specific configuration.

share|improve this answer
as i know --opt is on by default – SaveTheRbtz Aug 10 '09 at 8:43
up vote 0 down vote accepted

I've opened the ticket on

Workaround from there:

specify option --default-character-set=cp1251. But this workaround would not work with test case with mixed character sets

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.