I'm attempting to set up replication for a large (120 GB) MySQL database and I messed up.
I shut down the master, copied the data files, and restarted the master. Now I've set up the slave & started it up, and I realize that I neglected to get the
MASTER_LOG_POS values needed to setup replication.
I still have an untouched copy of the data files. Is there any way to determine
MASTER_LOG_POS from those files?
- what happens if you set the
MASTER_LOG_POSto an earlier point in time?
- Am I correct in assuming duplicate queries will be executed, possibly resulting in duplicate data?
I've been investigating the
mysqlbinlog command and discovered what looks like the correct info by executing:
mysqlbinlog --to-last-log --start-datetime='2015-06-21 20:05:00' mysql-bin.000006 | grep end_log_pos
The output looks something like this:
... a whole bunch more lines ... #150621 20:10:21 server id 1 end_log_pos 720159843 Query thread_id=901489 exec_time=0 error_code=0 #150621 20:10:21 server id 1 end_log_pos 720161877 Query thread_id=901489 exec_time=0 error_code=0 #150621 20:10:21 server id 1 end_log_pos 720162762 Query thread_id=901489 exec_time=0 error_code=0 #150621 20:10:22 server id 1 end_log_pos 720164796 Query thread_id=901489 exec_time=0 error_code=0 #150621 20:10:22 server id 1 end_log_pos 720164815 Stop
I'm guessing I should use one of those last two positions, but I'm not sure which.