MySQL Forums
Forum List  »  Newbie

Re: Comparing 2 Tables in different Databases
Posted by: Peter Brawley
Date: January 01, 2022 06:17PM

Replication remains the most efficient way to keep two servers in sync. Apart
from replication, SQL talks to one server at a time.

To run an SQL comparison of versions of a table from two different servers, you'd need to copy a table from server B to server A (eg mysqldump it from B, then import it to A), then on server A run a table-comparison query like that described under "Compare data in two tables" at https://www.artfulsoftware.com/queries.php.

Or, though it'd be slower, you could in a language with a MySQL API, eg PHP, connect to server A, make a second connection to server B, load the table from B into memory, and write a module in that language to compare the in-memory version with the table on server A.

Options: ReplyQuote


Subject
Written By
Posted
Re: Comparing 2 Tables in different Databases
January 01, 2022 06:17PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.