????A B ???? MySQL ??????????????????????????????汾 MySQL 5.5
?????????????????
????[A ?????? 192.168.1.100]
????server-id = 1
????binlog-do-db = test
????binlog-ignore-db = mysql
????replicate-do-db = test
????replicate-ignore-db = mysql
????sync-binlog = 1
????[B ?????? 192.168.1.101]
????server-id = 2
????binlog-do-db = test
????binlog-ignore-db = mysql
????replicate-do-db = test
????replicate-ignore-db = mysql
????sync-binlog = 1
????????A??B????????????
????????????????
????# A B ???????????
????STOP SLAVE;
????# A B ?????????MASTER???
????RESET MASTER;
????# A B ?????????SLAVE???
????RESET SLAVE;
????# A ??????????????? (??????????θ?????????????????????192.168.1%)
????GRANT REPLICATION SLAVE ON *.* TO 'master_slave'@'192.168.1%' IDENTIFIED BY '123456';
????FLUSH PRIVILEGES;
????# A ??????????????????2??????mysql??????????????
????FLUSH TABLES WITH READ LOCK;(??????????????????????????????????????????д??)
????# ??????SSH???????????????????????????
????tar -cvf /tmp/mysql-data.tar /www/mysql
????tar -xvf /tmp/mysql-data.tar -C /
????# ?? A ??????????????????????????????λ???
????SHOW MASTER STATUS;

????# B ??????????????????2??????mysql??????????????
????FLUSH TABLES WITH READ LOCK;
????# ??? B ?????????? (????A??????????????)
????CHANGE MASTER TO MASTER_HOST='192.168.1.100'??MASTER_USER='master_slave'??MASTER_PASSWORD='123456'??MASTER_LOG_FILE='binlog.000001'??MASTER_LOG_POS=106;
????MASTER_LOG_FILE ???A ??????show master status?е?File??MASTER_LOG_POS???A ??????show master status?е?Position

?????????????????????????????yes??????????????
????# ???? B ?????????????
????START SLAVE;
????# ?? B ??????????????????
????SHOW SLAVE STATUS;