Specifying Positions for Recovery
Specifying Positions for Recovery
Instead of specifying dates and times, the –start-position and –stop-position options for mysqlbinlog can be used for specifying log positions. They work the same as the start and stop date options, except that you specify log position numbers rather than dates. To determine the position numbers, run mysqlbinlog for a range of times Using following command.
mysqlbinlog –start-date=[start_date] –stop-date=[stop_date] /var/log/mysql/bin.122 > /tmp/mysql_position.sql
From mysql_position.sql, we can find position for stopping and resuming the recovery.Positions are labeled as log_pos followed by a number.After restoring the previous backup file, use the following command to recover up to the position.
mysqlbinlog –stop-position=”368312″ /var/log/mysql/bin.1223 | mysql -u root -p
