Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

info: my tables are all innodb.

i know i can create a mysql slave by copying the data from master to slave and noting the position in the binlog and set that on the slave. thus the slave should be able to replay all master binlog entries since the backup and sync that way.

but, in case the binlog exists from the start, can i simply set the binlog position on the slave to 0, thus not having to copy any data and just have the slave catch up to the most recent binlog entry?

share|improve this question

2 Answers 2

That could work if

  • You loaded data in an empty MySQL instance
  • You had binary logging enabled from the start
  • You never erased any of your binary logs

There is one catch: There is no literal position 0.

There is a different position 0 for different versions of MySQL

  • position 107 (MySQL 5.5)
  • position 106 (MySQL 5.1)
  • position 98 (MySQL 5.0 and prior)

I wrote about this a long time ago in the DBA StackExchange:

If you do not have every binary log since the inception of the MySQL Data Load, you could make a copy using rsync and one restart of mysql:

share|improve this answer

If you really have all the binlogs, and the database set up correctly, I can't think of any technical reason why not. The entire reason behind the binlog is to allow this sort of thing.

share|improve this answer

Your Answer

 
discard

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.