Can no longer disable MySQL tablespaces #1324

Closed
opened 2026-06-17 17:57:17 +00:00 by zewt · 2 comments

What I'm trying to do and why

mysqldump needs extra permissions to dump tablespaces. Prior to 2.1.6 you could disable them using --no-tablespaces if you don't use tablespaces to avoid needing extra permissions on the backup user, but this no longer works in 2.1.6 because it forces --all-tablespaces. This causes every run to output:

mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces

It's not fatal, it's just one command of mysqldump's failing and the rest of the output continues, but it definitely looks fatal (and isn't something people should get in the habit of ignoring).

I experimentally tried editing hooks/data_source/mysql.py to put --all-tablespaces earlier to see if simply moving it before extra_options would fix it, but --all-tablespaces still overrides --no-tablespaces. I don't know if people normally run their backups with PROCESS permissions and don't run into this, but it'd be nice to have a way to disable --all-tablespaces so it can still be run cleanly without the process permission.

Steps to reproduce

mysql_databases:

  • options: --no-tablespaces

Actual behavior

No response

Expected behavior

No response

Other notes / implementation ideas

No response

borgmatic version

2.1.6

borgmatic installation method

No response

Borg version

1.4.4

Python version

No response

Database version (if applicable)

mysql 8.0.46

Operating system and version

AlmaLinux 9.8

### What I'm trying to do and why mysqldump needs extra permissions to dump tablespaces. Prior to 2.1.6 you could disable them using --no-tablespaces if you don't use tablespaces to avoid needing extra permissions on the backup user, but this no longer works in 2.1.6 because it forces --all-tablespaces. This causes every run to output: mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces It's not fatal, it's just one command of mysqldump's failing and the rest of the output continues, but it definitely looks fatal (and isn't something people should get in the habit of ignoring). I experimentally tried editing hooks/data_source/mysql.py to put --all-tablespaces earlier to see if simply moving it before extra_options would fix it, but --all-tablespaces still overrides --no-tablespaces. I don't know if people normally run their backups with PROCESS permissions and don't run into this, but it'd be nice to have a way to disable --all-tablespaces so it can still be run cleanly without the process permission. ### Steps to reproduce mysql_databases: - options: --no-tablespaces ### Actual behavior _No response_ ### Expected behavior _No response_ ### Other notes / implementation ideas _No response_ ### borgmatic version 2.1.6 ### borgmatic installation method _No response_ ### Borg version 1.4.4 ### Python version _No response_ ### Database version (if applicable) mysql 8.0.46 ### Operating system and version AlmaLinux 9.8
Owner

Thanks for filing this. It looks like it was caused by #1303. What I think I'll do as a solution is to add a database-level configuration option to disable dumping of tablespaces. Then you wouldn't need to use extra_options for this, and you could just disable dumping of tablespaces directly.

Thanks for filing this. It looks like it was caused by #1303. What I think I'll do as a solution is to add a database-level configuration option to disable dumping of tablespaces. Then you wouldn't need to use `extra_options` for this, and you could just disable dumping of tablespaces directly.
Owner

This is implemented in main and will be part of the next release! The new option to disable this is just tablespaces: false in your database config. I also added similar events and routines options, and added all of these to the MySQL hook as well.

This is implemented in main and will be part of the next release! The new option to disable this is just `tablespaces: false` in your database config. I also added similar `events` and `routines` options, and added all of these to the MySQL hook as well.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
borgmatic-collective/borgmatic#1324
No description provided.