The cause of the problem: the main library has set the parameters from the library replicate_do_db to the library main, and the later application has created the database as middle in the main library, not changing this parameter setting causes the database middle to be synchronized from the library.
Workaround:
A. . backup the database to be synchronized in the main library middle:
/usr/local/mysql/bin/mysqldump-uroot-proot-s/tmp/mysql3307.sock--single-transaction--master-data=2-b Middle > Middle.sql
two . Transfer the backup middle.sql to the slave library.
In the From Library execution:
1.source middle.sql(recovering database from library middle)
2.stop slave sql_thread;
3.CHANGE REPLICATION FILTER replicate_do_db = (main,middle);
4.start slave sql_thread;
three. In order to restart in the future can also take effect, the parameter replicate_do_db and the specified master-slave synchronization of the database is written in the master-slave configuration file.
Pre-operation recommended read Official document:https://dev.mysql.com/doc/refman/5.7/en/change-replication-filter.html
Online service MySQL master-slave database synchronization inconsistency problem solving