1.master上創(chuàng)建同步用戶:
mysql>CREATE USER 'repl'@'%.example.com'? IDENTIFIEDBY? 'password';
mysql>GRANT REPLICATION SLAVE ON *.* TO 'repl'@'%.example.com';
mysql> show master status;?? //查看當(dāng)前日志信息
2.slave指定master信息及日志開始信息
mysql> CHANGE MASTER TO MASTER_HOST='192.168.1.186', MASTER_USER='repl2', MASTER_PASSWORD='password', MASTER_LOG_FILE='binlog.000067', MASTER_LOG_POS=681;
mysql> start slave;?????????? //啟動replication