Forum Moderators: open
mysqldump -u username -p database --skip-opt --add-drop-table --skip-comments --no-data ¦ perl -pe "s/^([^D]¦DROP\S)[^\n]*\n//ig" > test.sql
The forum breaks the pipe symbol, don't forget to replace with full pipe
That was one of the first things I tried, to no avail. Add that switch and the dump will remove any and all
DROP TABLEstatements, even if you put the
--add-drop-tableswitch back in after the
--no-create-info. I tried all kinds of variations. Tested on 5.0.7 and 5.1.31.
However, I do agree -- one would think that would be the answer and the way it should work! I didn't file a bug report, just created a workaround. Perhaps I should ask the developers ...
So the drop table info is part of the create info block. Definitely sounds like a bug to me.
Added Even if it's intentional, the documentation [dev.mysql.com] should be updated.