Be sure to remember reset before restoring from the library, because restarting MySQL does not affect the replication process, and if you forget reset, it will cause you to recover while the main library has actions to write from the library, when you change the master acid can not be guaranteed.
Reset slave All;
After clearing the master-slave information, you can start the recovery from the library with the Master library's full provisioning
[[Email protected]~]# mysql-uroot-p </databackup/fullbackup/20160403.sql
view in the main library backup set Binlog and the position Offset Amount
[Email protected]fullbackup]# cat/databackup/fullbackup/20160403.sql|grep "Change Masterto master_log_file= '"
--Changemaster to master_log_file= ' mysql-bin.000006 ', master_log_pos=120;
of the backup set Binlog The logs are here. mysql-bin.000006 Offset Amount position to the -
From library:
when you read the main library from the library configuration IP address, copy the user name and password from the main library which BINLOG What is the offset of the file starting to read?
mysql> Changemaster tomaster_host= ' 192.168.1.250 ', master_user= ' Mysync ', master_password= ' MANAGER ', master_port=4008, Master_log_file= ' mysql-bin.000006 ', master_log_pos=120;
Turn on the copy switch from the library
Mysql> Startslave;
Query OK, 0 rowsaffected (0.30 sec)
Mysql>show slave status\g;
This article is from the "Age volt" blog, please make sure to keep this source http://suifu.blog.51cto.com/9167728/1828042
MySQL Production library master-Slave resynchronization operation considerations