安装mysqldiff
yum install -y mysql-utilities
对比
mysqldiff --server1=user:pass@10.0.0.1:3306 --server2=user:pass@10.0.0.2:3306 db1:db2
mysqldiff --server1=user:pass@10.0.0.1:3306 --server2=user:pass@10.0.0.2:3306 db1.table1:db2.table1
--skip-table-options skip check of all table options (e.g., AUTO_INCREMENT,
ENGINE, CHARSET, etc.).
-d DIFFTYPE, --difftype=DIFFTYPE
display differences in context format in one of the
following formats: [unified|context|differ|sql]
(default: unified).
--show-reverse produce a transformation report containing the SQL
statements to transform the object definitions
specified in reverse. For example if --changes-for is
set to server1, also generate the transformation for
server2. Note: the reverse changes are annotated and
marked as comments.
网友评论