Sample Header Ad - 728x90

mysql diff and add diff records into new database

0 votes
1 answer
606 views
I have two database on two different hosts: * host A has database A and table A * table A contains records with primary key 1 to 10 * host B has database B and table B * table B contains records with primary key 1 to 5 Now I have to take a diff of the two separate host/databases/tables i.e. "host A/database A/table A" contains 1-10 and "host B/database B/table B" contains 1-5 so records 6-10 are missing in host B/database B/table B. Now add these diff records into "host B/database B/table B" from "host A/database A/table A". In short, update development database with new production data since last update. What I have tried:
mysqldump  --replace --complete-insert --skip-disable-keys --no-create-info -h A
  --port=3306 -u A --password=A database_A table_A 
  | mysql -h B -u B --password=B database_B
Asked by mOsEs (11 rep)
Feb 18, 2016, 12:39 PM
Last activity: Jan 26, 2025, 12:08 AM