准备两台mysql服务器,master(192.168.43.64)、slave(192.168.84.129)
master配置:
log-bin=mysql-bin
binlog_format=mixed
server_id=1
binlog_checksum=none
slave配置:
![2c2bd2a1fcd3b648e6ce897f477510ad.png](https://i-blog.csdnimg.cn/blog_migrate/c8f3a26bcd1e9caab6d6e444f45540e9.jpeg)
然后给master授权并查看二进制文件名称和位置:
![cd2c73a9a3fbe3eccbe52ab0d6e63581.png](https://i-blog.csdnimg.cn/blog_migrate/085579797564b9d5bcfa75699641f053.jpeg)
进入从服务器执行如下sql并开启slave、查看slave状态:
change master to master_host='192.168.43.64' ,master_user='root' ,master_password='123' ,master_log_file='mysql-bin.000032&