I have 2 databases, with ~100,000 rows missing from the table field_collection_item
from db1
, which I\'d like to repair by exporting from db2
If your tables are MyISAM, the safest, easiest way to handle this is to pass the flag --lock-all-tables
. If your tables are InnoDB then --single-transaction
is better.
If you don't need a consistency guarantee, you can disable locking without single transaction by adding:
--lock-tables=false
I use this to do the same thing you're after (dumping subsets of the data) and on replication slaves that I can stop (making it consistent anyway).
An advantage over --single-transaction
is that you can use/mix non-MVCC-engine tables.