Bug #84133 mysqldump does not have an --exclude-databases option
Submitted: 9 Dec 2016 1:55 Modified: 6 Oct 2017 22:00
Reporter: David Gow (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S4 (Feature request)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any
Tags: mysqldump

[9 Dec 2016 1:55] David Gow
Description:
There is no way in mysqldump to dump all databases save for a few, without passing all of these databases as options.

This means that there is no way to easily dump, for example, all databases except the `mysql` system database.

How to repeat:
The mysqldump documentation does not show any equivalent option.

Suggested fix:
Add an --exclude-databases option which, when --all-databases is in use, excludes the listed databases from the dump.
[9 Dec 2016 7:15] MySQL Verification Team
Hello David Gow,

Thank you for the reasonable feature request.

Thanks,
Umesh
[6 Oct 2017 21:57] David Gow
--exclude-databases implementation patch against 5.7 git (a533e2c786…)

Attachment: 0001-Add-an-exclude-databases-option-to-mysqldump.patch (text/x-patch), 4.60 KiB.

[6 Oct 2017 22:00] David Gow
I've attached the patch we've used to implement this.
It's based on the 5.7 git branch's 5.7.19 tag.

Let me know if you're interested in this, with or without any changes (or the version we have against 5.6)?

Cheers,
— David