O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Non-blocking backup

To provide consistent backup, mydumper acquires GLOBAL LOCK by executing FLUSH TABLES WITH READ LOCK.

You have already seen how dangerous it is to use FLUSH TABLES WITH READ LOCK if there are any long-running transactions (explained in Chapter 5, Transactions). To avoid that, you can pass the --kill-long-queries option to kill blocking queries rather than aborting mydumper.

  • --trx-consistency-only: This is equivalent to --single-transaction for mysqldump but with a binlog position. Obviously, this position only applies to transactional tables. One of the advantages of using this option is that the global read lock is only held for the threads' coordination, so it's released as soon as the transactions are started.
  • --use-savepoints ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required