Point-in-time recovery
To get point-in-time recovery, you should specify --single-transaction and --master-data.
The --single-transaction option provides consistent backup by changing the transaction isolation mode to REPEATABLE READ and executing START TRANSACTION before taking a backup. It is useful only with transactional tables, such as InnoDB, because then it dumps the consistent state of the database at the time START TRANSACTION was issued without blocking any applications.
The --master-data option prints the binary log coordinates of the server to the dump file. If --master-data=2, it prints as a comment. This also uses the FLUSH TABLES WITH READ LOCK statement to get a snapshot for the binary logs. As explained in Chapter 5, Transactions ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access