Skip to Main Content

Best way to get binary log file and position without backing up binary and relay logs

3578012Oct 18 2019 — edited Oct 21 2019

When we've needed to resync a slave we took a mysqlbackup from the master, applied the log and then the incrementals if needed, and then transferred the files to the slave and restored the database.  When we changed the master information for the binlog file and position, we used what was provided in the result of the apply-log or apply-incremental-backup command.  This has worked well for most instances, but we encountered an issue on an archive server that sees little change.  We needed to restore replication, but after restoring the database I used the binlog file and position and got the response that the slave couldn't find that binary log.  After doing some investigation, I discovered that the binary log it gave me was over two weeks old and we only keep a week's work of binary logs.  Is there a place in the mysql system database that holds the current binlog file and position that can be used for this?  We are using MySQL 5.6.40 and mysqlbackup 3.12.  We are planning on upgrading soon but it will take some time until we can upgrade everything.

Post Details
Added on Oct 18 2019