3.1.5 How Can I Synchonize a Table on Two Servers Where Neither is Up-to-date?

3.1.5.1 Objectives
3.1.5.2 Example Execution
3.1.5.3 Discussion
3.1.5.4 Permissions Required
3.1.5.5 Tips and Tricks

When working with servers that are used in different networks or are compartmentalized, or simply intentionally manually redundant (they do not use replication), or perhaps through some crisis, you may encounter a situation where a table (or an entire database) becomes out of synch.

We don't simply want to know which rows differ, rather, we need to know the SQL statements needed to bring the tables into synch. Furthermore, we aren't sure which table is most out of date so we'd like to see the transformation statements for both directions.

In this case, it would be very helpful to know exactly how the tables differ. For this, we use the mysqldbcompare utility.