From c2276b18c5167df3ebae690f48e59dbdc204a6ec Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Thu, 14 Nov 2019 10:33:47 -0800 Subject: [PATCH] Add troubleshooting documentation for MySQL lock table errors (#244). --- docs/how-to/backup-your-databases.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/how-to/backup-your-databases.md b/docs/how-to/backup-your-databases.md index 7d401de..de21192 100644 --- a/docs/how-to/backup-your-databases.md +++ b/docs/how-to/backup-your-databases.md @@ -173,6 +173,24 @@ after backups. So if necessary, you can use these hooks to create database dumps with any database system. +## Troubleshooting + +### MySQL table lock errors + +If you encounter table lock errors during a database dump with MySQL/MariaDB, +you may need to [use a +transaction](https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html#option_mysqldump_single-transaction). +You can add any additional flags to the `options:` in your database +configuration. Here's an example: + +```yaml +hooks: + mysql_databases: + - name: posts + options: "--single-transaction --quick" +``` + + ## Related documentation * [Set up backups with borgmatic](https://torsion.org/borgmatic/docs/how-to/set-up-backups/)