In my replication environment I had a hardware failure on master
host. A 4.5.GB table containing blob images wa corrupted, so I
issued a REPAIR TABLE and the effect was to repair the table but
also to reduce the number of rows: master table had just 41 rows
less than the copies on the slave hosts on a total of a hundred
thousand rows.
So, the problem now is how to recover only those rows from a
slave and re-populate the master table avoiding to dump the
entire table. And how to do that with a single command line
instruction?
We can use a couple of mysqldump options.
The first option to use is –where=”where_condition”, it
dumps only rows selected by the given WHERE condition.
So let’s try a first instruction.
slave1:/> mysqldump -u root -proot_pwd --where="idimg between
93305 and 93346" mydb images | mysql -h master_host -u root
-proot_pwd mydb
But …
[Read more]