mysqldiff 安装
wget -c http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-utilities-1.5.3.zip unzip mysql-utilities-1.5.3.zip cd mysql-utilities-1.5.3 python ./setup.py build python ./setup.py install
mysqldiff --server1=root:MThjN2Y3Zj@10.50.51.57:30306 --server2=root:N2Z3yjMhTj@10.50.51.56:30307 --force --difftype=sql upnp:elink mysqldiff --server1=root:MThjN2Y3Zj@10.50.51.57:30306 --server2=root:N2Z3yjMhTj@10.50.51.56:30307 upnp.upnp_dmz:upnp.upnp_dmz
https://blog.csdn.net/lanwilliam/article/details/78664620
https://www.cnblogs.com/Yongzhouunknown/p/4856765.html
脚本
#!/bin/bash host1="10.50.51.57" host2="10.50.51.56" user1="root" user2="root" pass1="MThjN2Y3Zj" pass2="N2Z3yjMhTj" port1="30306" port2="30307" #mysqldiff --server1=root:MThjN2Y3Zj@10.50.51.57:30306 --server2=root:N2Z3yjMhTj@10.50.51.56:30307 upnp.upnp_dmz:upnp.upnp_status echo "" >sql.txt for i in `cat list`;do echo "------------------------------------------------------------------------------------" >>sql.txt echo $i >>sql.txt echo "" >>sql.txt echo "" >>sql.txt mysqldiff --server1=$user1:$pass1@$host1:$port1 --server2=$user2:$pass2@$host2:$port2 $i:$i >>sql.txt echo "" >>sql.txt echo "" >>sql.txt echo "------------------------------------------------------------------------------------" >>sql.txt done
upnp.upnp_dmz
elink.elink_switch