I use replica instead source database for backups. After enabling GTID mode I am not sure how I should use mysqldump to make correct dump. This backup is for source recovery of course.

mysqldump --single-transaction db > dump.sql


mysqldump --single-transaction --set-gtid-purged=OFF db > dump.sql


MySQL version is 8.0.

  • Which mysql version are you using? Nov 5 at 11:38
  • I use mysql 8.0
    – deem
    Nov 5 at 13:08
  • specifying the exact version (major + minor) is needed. Officials docs states that mixing --single-transaction and --set-gtid-purged could cause inconsistencies. Nov 7 at 6:24


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.