I am having a problem in mysql replication.

I have a mysql raw data snapshot and my master host have 2 binary logs (binlog.01, binlog.02 - start to log after snapshot was created)

What I want to do is copy raw data snapshot to slave host, execute binlog.01 using mysqlbinlog utility and then at change master to master host point to binlog.02 at the start postion 1.

When slave process the both of binary logs completely, I use mk-table-checksum to check the replication and I get a dozen of inconsistent message.

However, with another method, I try to copy raw data snapshot to slave host again, change master to master host point to binlog.01 at start position 1 - without process any mysqlbinlog command - I realized that I does not get any inconsistent message when using mk-table-checksum anymore.

I want to know that why database is inconsistent when using mysqlbinlog. Please, any help would be appreciated.

  • How did you take the raw data snapshot?
    – quanta
    Oct 10 '11 at 10:58
  • Are the Master and Slave the same version of MySQL?
    – HTTP500
    Oct 10 '11 at 13:27
  • @quanta I got raw data by stop mysql service and copy it to slave host
    – ntseries
    Oct 11 '11 at 8:24
  • @jasondbecker yes, they are the same
    – ntseries
    Oct 11 '11 at 8:26

It looks like you'are doing in wrong way. How can you know that binlog.01, binlog.02 are created right after you take snapshot?

The right way is:

  • stop master or flush tables with read lock;
  • determine the current binlog file and position with show master status;
  • take data snapshot
  • copy snapshot to the slave
  • configure the slave with replication coordinates from the master change master to
  • start the slave threads

Your Answer

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

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