How do I see the differences between 2 MySQL dumps?

后端 未结 6 869
既然无缘
既然无缘 2020-12-29 21:19

I have 2 MySQL dump files. I want to find the table data difference between 2 tables.

6条回答
  •  有刺的猬
    2020-12-29 21:55

    run mysqldump with "--skip-opt" to get the 2 dumps files i.e:

    mysqldump --skip-opt -u $MY_USER -p$MY_PASS mydb1 > /tmp/dump1.sql
    
    mysqldump --skip-opt -u $MY_USER -p$MY_PASS mydb2 > /tmp/dump2.sql
    

    compare using these diff options:

    diff -y --suppress-common-lines /tmp/dump1 /tmp/dump2
    

提交回复
热议问题