????????Mysql?????????????????
????????Master??
????mysql>show processlist;??????????Sleep??????????????
????show master status;???????
????mysql>show master status;
????+-------------------+----------+--------------+-------------------------------+
????|File|Position|Binlog_Do_DB|Binlog_Ignore_DB|
????+-------------------+----------+--------------+-------------------------------+
????|mysqld-bin.000001|3260||mysql??test??information_schema|
????+-------------------+----------+--------------+-------------------------------+
????1 row in set(0.00 sec)
???????Slave???
????mysql>show slave statusG
????Slave_IO_Running:Yes
????Slave_SQL_Running:No
?????????Slave?????
???????????????????????
??????????????????????????
?????÷????????????????????????????????????????????????????????????????
?????????
????stop slave;
????#?????????????????????????
????set global sql_slave_skip_counter=1;
????start slave;
???????????mysql>show slave statusG????
????Slave_IO_Running:Yes
????Slave_SQL_Running:Yes
????ok??????????????????????????
????????????????????????????
?????÷????????????????????????????????????????????
??????????????£?
????1.?????????????????????????д??
???????????
????mysql>flush tables with read lock;
????????????????????????????????Сд
????2.???????????
????#??????????mysql.bak.sql???
????[root@server01 mysql]#mysqldump-uroot-p-hlocalhost>mysql.bak.sql
???????????????????????????????У???????shell???????python??????????????????????????
????3.??master??
????mysql>show master status;
????+-------------------+----------+--------------+-------------------------------+
????|File|Position|Binlog_Do_DB|Binlog_Ignore_DB|
????+-------------------+----------+--------------+-------------------------------+
????|mysqld-bin.000001|3260||mysql??test??information_schema|
????+-------------------+----------+--------------+-------------------------------+
????1 row in set(0.00 sec)
????4.??mysql?????????????????????????????
????#???scp????
????[root@server01 mysql]#scp mysql.bak.sql root@192.168.128.101:/tmp/
????5.????????
????mysql>stop slave;
????6.?????????mysql???????????????
????mysql>source/tmp/mysql.bak.sql
????7.?????????????????????????????show master status??????|File|Position????
????change master to master_host='192.168.128.100'??master_user='rsync'??master_port=3306??master_password=''??master_log_file='mysqld-bin.000001'??master_log_pos=3260;
????8.???????????
????mysql>start slave;
????9.???????
????mysql>show slave statusG????
????Slave_IO_Running:Yes
????Slave_SQL_Running:Yes
???????????????????