1

I'm using MySQL GUI tool to backup my innodb database and I use the option '--single-transaction' to get a consistent copy as backup.

I have however, noticed that if I backup using command line mysqldump tool, the backup process speeds up noticeably. I am wondering if is possible to mention --single-transaction in command line mysqldump utility?

1 Answer 1

3

Sure enough, --single-transaction is supported from the MySQL command line.

mysqldump --single-transaction databasename

Will use all of the default options from --opt (except for --lock-tables, which is overridden by --single-transaction) as well as --single-transaction.

That really should be all there is to it.

I recommend briefly reading through all of the options of mysqldump - you may find that some of them, like --routines, are important for your database.

1
  • I know it's an old answer but I add this comment if other finds this. I have really tried to find out from the MySQL manuals if --single-transaction overrides --lock-tables. I couldn't find a clear statement otherwise than The --single-transaction option and the --lock-tables option are mutually exclusive. Perhaps it's obvious, but I rely on this answer. I hope it's still the case. MySQL 5.7.29.
    – 244an
    Mar 13, 2020 at 23:18

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.