Skip to main content
Common Reference

Identify Structural Differences

If you suspect that there are differences to a table structure, a simple method to resolve this will be to compare schema DDL.

Extract DDL on the Primary node, specifying the schema in place of [DB]:

shell> mysqldump -u root -p --no-data -h localhost --databases [DB] >Primary.sql

Repeat the same on the Replica node:

shell> mysqldump -u root -p --no-data -h localhost --databases [DB] >Replica.sql

Now, using diff, you can compare the results

shell> diff Primary.sql Replica.sql

Using the output of diff, you can then craft the necessary SQL statements to re-align your structure.