??????????mysql????????????????????????????????????£?
????1????????????????????2?????
????1.1???汾???
????1.2???????????????????mysql
????1.3?????root??????
????2?????????????master:
????#vi /etc/my.cnf
????[mysqld]
????log-bin=mysql-bin   //[????]????????????
????server-id=222       //[????]??????ID???????1??????IP?????
????3???????????slave:
????#vi /etc/my.cnf
????[mysqld]
????log-bin=mysql-bin   //[????]????????????
????server-id=226       //[????]??????ID???????1??????IP?????
????4?????????????????mysql
????/etc/init.d/mysql restart
????5?????????????????????????slave:
????#/usr/local/mysql/bin/mysql -uroot -pmttang
????mysql>GRANT REPLICATION SLAVE ON *.* to 'mysync'@'%' identified by 'q123456'; //?????root????“%”??????п??????????????????????????????????t???????IP???棬??192.168.145.226??????? ???
????6???????????????mysql?????master????
????mysql>show master status;
????+------------------+----------+--------------+------------------+
????| File                      | Position | Binlog_Do_DB | Binlog_Ignore_DB |
????+------------------+----------+--------------+------------------+
????| mysql-bin.000004 |      308 |              |                  |
????+------------------+----------+--------------+------------------+
????1 row in set (0.00 sec)
???????????????????????????????MYSQL?????????????????仯
????7????????????Slave??
????mysql>change master to aster_host='192.168.145.222'??master_user='tb'??master_password='q123456'??
????master_log_file='mysql-bin.??000004'??master_log_pos=308;   //?????????“308”????????
????Mysql>start slave;    //?????????????????
????8??????????????????????
mysql> show slave statusG
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.2.222  //???????????
Master_User: myrync         //?????????????????????root
Master_Port: 3306           //????????????汾??д???
Connect_Retry: 60
Master_Log_File: mysql-bin.000004
Read_Master_Log_Pos: 600        //#?????????????????λ??????????>=Exec_Master_Log_Pos
Relay_Log_File: ddte-relay-bin.000003
Relay_Log_Pos: 251
Relay_Master_Log_File: mysql-bin.000004
Slave_IO_Running: Yes       //????????YES
Slave_SQL_Running: Yes       //????????YES
......
???????Slave_IO??Slave_SQL??????????????У???YES????????????????(?磺???????NO???????)??
???????????????????????????????ɡ?