Description:
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.
Cheers
//Steve
Suggested fix:
mysqldump --ignore-table-data=[tablename | dbname.tablename] option