标签:column category using show comm 方式 rev command eve
mysqldiff只能比较两个数据库都有的表之间的差异,也就是说它不会生成create语句。
`mysqldiff --server1=user:pass@host:port:socket --server2=user:pass@host:port:socket db1.object1:db2.object1 db3:db4`
mysqldiff --skip-table-options --difftype=sql --changes-for=server2 --server1=root:root@10.63.2.212 --server2=root:yearning@192.168.154.129 test:test
结果:
# WARNING: Using a password on the command line interface can be insecure.
# server1 on 10.63.2.212: ... connected.
# server2 on 192.168.154.129: ... connected.
# WARNING: Objects in server1.test but not in server2.test:
# TABLE: category
# Compare failed. One or more differences found.
mysqldiff --skip-table-options --difftype=sql --changes-for=server2 --server1=root:root@10.63.2.212 --server2=root:yearning@192.168.154.129 test:test
mysqldbcompare --skip-table-options --difftype=sql --changes-for=server2 --server1=root:root@10.63.2.212 --server2=root:yearning@192.168.154.129 test:test
结果:
# WARNING: Using a password on the command line interface can be insecure.
# server1 on 10.63.2.212: ... connected.
# server2 on 192.168.154.129: ... connected.
# WARNING: Objects in server1.test but not in server2.test:
# TABLE: category
# Compare failed. One or more differences found.
mysqldiff --skip-table-options --difftype=sql --changes-for=server2 --server1=root:root@10.63.2.212 --server2=root:yearning@192.168.154.129 test.category:test.category
结果:
# server1 on 10.63.2.212: ... connected.
# server2 on 192.168.154.129: ... connected.
# Comparing test.category to test.category [FAIL]
# Transformation for --changes-for=server2:
#
ALTER TABLE `test`.`category`
CHANGE COLUMN id id int(11) unsigned NOT NULL,
ADD COLUMN name varchar(30) NOT NULL AFTER id,
ENGINE=MyISAM;
# Compare failed. One or more differences found.
标签:column category using show comm 方式 rev command eve
原文地址:https://www.cnblogs.com/gelu/p/9510897.html