Main 1:192.168.246.130Main 2:192.168.246.131Master 1 Compounding: my.conf server_id= the Log-Bin=Mysql-bin Binlog-Format=Mixed Relay-Log=Mysql-Relay Master 2 compounding: my.conf server_id=131 Log-Bin=Mysql-bin Binlog-Format=Mixed Relay-Log=Mysql-Relay Master 1/2 Authorization:Grant ReplicationClientReplicationSlave on *.* to 'Repl'@'192.168.%.%'identified by 'Repl'; Master 1: View the primary server status value MYSQ>show master status;+------------------+----------+--------------+------------------+-------------------+| File |Position|binlog_do_db|binlog_ignore_db|Executed_gtid_set|+------------------+----------+--------------+------------------+-------------------+|Mysql-Bin.000001 | 467 | | | |+------------------+----------+--------------+------------------+-------------------+Change Master toMaster_host='192.168.246.131', Master_user='Repl', Master_password='Repl', Master_log_file='mysql-bin.000003', Master_log_pos=467; Master 2: View the primary server status value MYSQ>show master status;+------------------+----------+--------------+------------------+-------------------+| File |Position|binlog_do_db|binlog_ignore_db|Executed_gtid_set|+------------------+----------+--------------+------------------+-------------------+|Mysql-Bin.000003 | 467 | | | |+------------------+----------+--------------+------------------+-------------------+Change Master toMaster_host='192.168.246.130', Master_user='Repl', Master_password='Repl', Master_log_file='mysql-bin.000001', Master_log_pos=467;--remember a command--reset Slave;--start slave;--stop slave;--Show slave status \g--Show Master Status \g
MySQL Primary master replication