10Nov/090
MySQL Selective Dump
This is just something I was wondering about, whether I could back up specific rows I am going to modify during test, so I can re-insert them all after I have finished and deleted my test data.
To selectively dump just specifc rows from your mysql table you can use the following:
mysqldump --where=domain_id='7' -t -umyueser mydatabase mytable > mydumpfile.sql
Omitting the "-t" option will also place the drop and re-create table SQL into your dumpfile. It can be handy if you just want to backup a specific set of data from your db. Note it does not create REPLACE INTO's though so you would need to delete the matching rows before restoring from such a dumpfile.