Bug #60249 mysqldump --ignore-table-data option
Submitted: 25 Feb 2011 9:13 Modified: 25 Feb 2011 13:02
Reporter: Stephen Jackson Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: mysqldump Command-line Client Severity:S4 (Feature request)
Version:All OS:Any
Assigned to: CPU Architecture:Any
Tags: mysqldump backup tables

[25 Feb 2011 9:13] Stephen Jackson
Can't we have an ignore-table-data option that allows us, in a single mysqldump operation, to dump the structure and data, but ignore data on a per table basis instead of just the global --no-data option?

Maybe I am missing something, but I have looked all over for an option like this in mysqldump without any success.

A feature like this would save us then doing a second mysqldump -d on those tables only to get structure... 

I think this would be a very nice feature for most admins, and would save storage space for many who don't want to have to mess around with multiple calls just to get structure of volatile tables, and just write bog standard mysqldump's to get everything in one go regardless.

How to repeat:
mysqldump -hlocalhost -uroot -pxxxxxx testdb --ignore-table-data=testdb.sessions --ignore-table-data=testdb.cachedpages > dump.sql

Obviously, no such switch so this will fail.

Oh, while we are on the subject, it would be nice to not have to write dbname.tablename in both --ignore-table and any future --ignore-table-data if you are not specifying --all-databases. It seems kind of silly to have to specify this if you are dumping a named database.



Suggested fix:
mysqldump --ignore-table-data=[tablename | dbname.tablename] option
[25 Feb 2011 13:02] Valeriy Kravchuk
Thank you for the feature request.