mysqldiff比较数据库之间差别

  1. 比较数据库
mysqldiff --server1=root:[email protected]:3306 --server2=root:[email protected]:3306 db1:db2
# WARNING: Using a password on the command line interface can be insecure.
# server1 on 192.168.1.xxx: ... connected.
# server2 on 192.168.1.xxx: ... connected.
# WARNING: Objects in server1.iot_brain but not in server2.db2:
#        TABLE: bi_report
#        TABLE: event_record
#        TABLE: bind
#        TABLE: bi_report2
# WARNING: Objects in server2.iot3 but not in server1.db1:
#        TABLE: device_copy
Compare failed. One or more differences found.
  1. 比较表
mysqldiff --server1=root:[email protected]:3306 --server2=root:[email protected]:3306 db1.table1:db2.table2 --skip-table-options
# WARNING: Using a password on the command line interface can be insecure.
# server1 on 192.168.1.xxx: ... connected.
# server2 on 192.168.1.xxx: ... connected.
# Comparing db1.table1 to db2.table2            [PASS]
# WARNING: Table options are ignored and differences were found:
# --- idb1.table1
# +++ db2.table2
# @@ -1,4 +1,4 @@
#  ENGINE=InnoDB
# -AUTO_INCREMENT=137
# +AUTO_INCREMENT=2896
#  DEFAULT
#  CHARSET=utf8
Success. All objects are the same.
  1. 问题解决
-bash: !@192.168.1.xxx: event not found

字符’!‘需要前添加转义符号’\’

发布了53 篇原创文章 · 获赞 20 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/lylfv/article/details/90208637