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 ...

Get MySQL 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.