MySQL主從同步(binlog方式)與主從切換
阿新 • • 發佈:2019-01-28
mysql> change master to
-> master_host='192.168.2.63',
-> master_port=3306,
-> master_user='repl',
-> master_password='repl',
-> master_log_file='mysql-bin-1.000001',
-> master_log_pos=76;
Query OK, 0 rows affected, 2 warnings (0.34 sec)
mysql> start slave;
Query OK, 0 rows affected (0.04 sec)
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.2.63
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin-1.000001
...........
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
...........
Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O
...........
1 row in set (0.00 sec)