Bug #50852 RFE: --file-per-database, --compress-output-with
Submitted: 2 Feb 2010 20:07 Modified: 3 Feb 2010 7:52
Reporter: Kevin Benton Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version:Any OS:Any
Assigned to: CPU Architecture:Any
Tags: mysqldump

[2 Feb 2010 20:07] Kevin Benton
Description:
In mysqldump, it would be very helpful if it were possible to have mysqldump take care of naming files based on the name of the database within the instance.  This would allow me to take full dumps of active databases while gaining the benefit of having the databases stored in separate files, making it easier to grab data just for that database in the event that a restore from a mysqldump is required.

Adding --compress-output-with='/usr/bin/gzip' (as an example) would allow me to tell the system to create the file and use gzip on it right afterward or better yet - somehow know to just store the file in the compressed format.  Naming may be a bit of a challenge, however, this would prevent the system from having to deal with as much I/O during the dump.

How to repeat:
See description.

Suggested fix:
See description.
[3 Feb 2010 7:52] Valeriy Kravchuk
Thank you for the feature request.
[15 Nov 2014 10:28] Daniƫl van Eeden
The file-per-database part is a duplicate of Bug #45003

However the compression options are useful.
I can see two solutions:
1. Let mysqldump compress each file with $compress_program
2. Let mysqldump write a tar stream (like Percona XtraBackup) which then can be redirected to a compression program and/or netcat/ssh/etc.

For option 1 it might an external compression program or a library (like the lz4/zlib/lzma support of MySQL Enterprise Backup). Both should be possible on Winodws.
For option 2 might help to get a better compression ratio. If the zip format also allows streaming the stream can also be in zip format. A file created from a tar stream might nog be compatible with all tar implementations and/or might need special options (-i with GNU tar).