1, first off B, the data of a to export, mysqldump-hlocalhost-uroot-p123456--database IBPRPU >ibprpu.sql
2. Turn off A, start B, enter MySQL to create a new database Ibprpu
3, Import Database mysql-hlocalhost-uroot-p123456 <ibprpu.sql,
or go to MySQL and import the database via command Source/root/ibprpu.sql
4, modify a and B configuration files, my.cnf, restart A and B
5, Note: Some version my.cnf in the Replication property configuration does not work, first close slave, then change master
6, stop slave;
Change master to master_host= ' 192.168.1.101 ', master_port=3306,master_user= ' root ', master_password= ' 123456 ';
You also need to specify master_log_file and Master_log_pos when necessary.
7. The last_io_errno:1236 error is caused by reading an invalid location from Master, performing a show master status on the host, viewing the location of the binary log, and shutting down Slave,change master on the standby machine. Re-specify Master_log_pos.
If there are errors, stop slave; set global sql_slave_skip_counter=1; start slave;
Configuration flow for MySQL master master replication