搭建复制的必备条件:复制的机器之间网络通畅,Master打开了binlog。 搭建复制步骤: 创建复制账户:GRANT REPLICATION SLAVE ON *.* TO ‘repl’@‘%’ IDENTIFIED BY’xxx’; SHOW MASTER STATUS;记录下File和Postion。 在Slave上CHANGE MASTER TO master_host=‘IP’, master_user=‘repl’, master_password=‘xxx’, master_log_file=‘mysql-bin.00000x’, master_log_pos=pos; Slave上执行Slave start开始复制。