创建用户账号
1 GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.*
2 TO repl@'10.70.8.%' IDENTIFIED BY 'mysql';
查看主库的二进制日志文件的状态信息
https://dev.mysql.com/doc/refman/5.7/en/show-master-status.html
1 SHOW MASTER STATUS;
启动复制
1 change master to master_host='10.70.8.58',
2 master_user='repl',
3 master_password='mysql',
4 master_log_file='bin.000019',
5 master_log_pos=1067207908;
查看复制线程状态
https://dev.mysql.com/doc/refman/5.7/en/show-slave-status.html
1 SHOW SALVE STATUS;
备库开始复制
1 START SLAVE;