环境:windows server 2012
打开CMD命令行模式,
>cd c:Program FilesMysqlMysql 5.7.1in
c:Program FilesMysqlMysql 5.7.1in>mysqldump --no-data -h192.168.1.150 -uroot -proot --databases db1 db2 db3>D: emp-sql1150-structurebackupfile.sql
c:Program FilesMysqlMysql 5.7.1in>mysqldump --no-data -h192.168.1.152 -uroot -proot --databases db1 db2 db3>D: emp-sql1152-structurebackupfile.sql
使用文件对比工具,对比两个mysql服务器的数据库是否一致。
参考:
mysql命令行备份数据库(博客园的文章)