MySQL master-slave replication test:
1. Configure the primary server:
Add a copy account to the main library
GRANT REPLICATION SLAVE on * * to ' mark ' @ '% ' identified by ' Mark ' with GRANT OPTION;
To add a configuration in the My.ini configuration file:
[Mysqld]
# Unique identifier of the service
Server-id=1
# Open binary log, default path under data/
Log-bin=mysql-bin
# binary file format
Binlog_format=row
View Status:
SHOW MASTER Status
2. Configure the Slave server:
server-id=2
Log-bin=mysql-bin
Binlog_format=row
To link a host on a Slave machine:
Change Master to master_host= "192.168.96.12", master_port=3306, master_user= "Mark", master_password= "Mark",
Master_log_file= "mysql-bin.000004", master_log_pos=107, master_connect_retry=10;
Start IO threads and SQL threads on the standby machine
Mysql>start slave;
View Status:
Show slave status
Then create a database db1 on master, build the table TB1, insert the data for testing
If an error occurs during the copy process, no subsequent replication is required, and slave can be set to skip the error:
#slave-skip-errors=1062,1053,1146 #跳过指定error No type error
#slave-skip-errors=all #跳过所有错误
MySQL master-slave replication test