According to the error, the obtained main library file format is wrong.
First, lock the master-slave Normal Library
Mysql> flush tables with read lock; Lock table
Unlock tables; Unlock
SHOW MASTER STATUS;
Main MySQL add user to connect from server: GRANT REPLICATION SLAVE on * * to ' rep ' @ '% ' identified by ' logzgh ';
Second, close the master-slave from the library: slave stop;
mysql> change MASTER to master_host= ' qa-sandbox-1′, IP Address
Master_user= ' rep ', user name
Master_password= ' Logzgh ', password
Master_log_file= ' mysql-bin.000007′, location name
master_log_pos=471632;Offset Amount
Re-open slave from library: slave start;
Unlock Main library: Unlock tables; Unlock
show slave status\g;
SHOW MASTER STATUS;
The following six items need to be set on slave: replicate_do_db: Set the database to be replicated, multiple DB separated by commas replicate_ignore_db: Set the database that can be ignored. Replicate_do_table: Set the tablereplicate_ignore_table to be copied: Set the Table that can be ignoredreplicate_wild_do_table: Functions with replicate_do_table, but can be set with wildcard characters. Replicate_wild_ignore_table: function with replicate_do_table, function with replicate_ignore_table, can carry wildcard characters. The advantage is that the replication filtering mechanism is set at the slave end, which guarantees that there will be no inconsistency or replication error between the slave and master data due to the default database problem. The disadvantage is that the performance is worse than the master side. The reason: whether or not you need to replicate, Events are read by the IO thread to the slave side, which not only increases the amount of network Io, but also increases the write volume of relay log for the IO thread on the slave side.
MySQL Dual master fault resolution example.