Jun 01, 2021 Article blog
MySQL
databases support replication of different business scenarios, such as one-way, two-way, chain cascading, ring, and so on.
During replication, one server acts as the master server, receiving content updates from the user, while one or more other servers act as slaves, receiving log content from the primary server
binlog
file, parsing
SQL
and re-updating to the slave database, bringing the data from the primary slave server into line.
mysql
default profile is
/etc/my.cnf
Set the service id and turn on the binary log file.
server-id=1 log-bin=mysql-bin
CREATE USER 'zyk'@'132.232.37.228' IDENTIFIED BY 'zyk123'
GRANT REPLICATION SLAVE ON *.* TO 'zyk'@'132.232.37.228';
flush privileges;
SHOW MASTER STATUS;
CHANGE MASTER TO MASTER_HOST='cxygg.top', MASTER_USER='zyk', MASTER_PASSWORD='zyk123', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=771;
start slave;
show slave status;
The above is
W3Cschool编程狮
about mysql master copy configuration, I hope to help you.