![](https://csdnimg.cn/release/download_crawler_static/88014842/bg5.jpg)
3)连接主库,从找到的 binlog 日志位置点往下恢复增量的数据(找位置点,打开同步开关)
[root@localhost ~]# mysql -uroot -p123
mysql> change master to master_host='192.168.37.128',
-> master_port=3306,
-> master_user='rep',
-> master_password='123',
-> master_log_file='mysql-bin.000001',
-> master_log_pos=331;
mysql> start slave; #开启增量同步数据的开关
mysql> show slave status\G
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| ku |
| mysql |
| performance_schema |
| test |
+--------------------+
mysql> select * from ku.biao; #查看全备的数据和后来主库增量的数据(都补齐了)
+------+------+
| id | name |
+------+------+
| 1 | shi1 |
| 2 | shi2 |
| 3 | shi3 |
| 4 | shi4 |
| 5 | shi5 |
+------+------+
mysql> quit
3.在 192.168.37.128(主)上:创建新的数据库和增加新的数据
[root@localhost ~]# mysql -uroot -p123
mysql> create database ku1;
mysql> use ku1;
mysql> create table biao1 (id int(2),name varchar(10));
mysql> insert into biao1 values (1,'test1');
mysql> insert into biao1 values (2,'test2');
mysql> insert into biao1 values (3,'test3');
mysql> show databases;
+--------------------+
| Database |