#现有环境是一主一从, you need to add another one from the library, as follows:
Synchronizing the test database
Master: 192.168.3.203
From 1:192.168.3.210
From 2:192.168.3.211
1. Set up accounts for 210 and 211 on primary server 203.
Mysql-uroot-p123
Grant Replication Slave on * * to ' backup ' @ ' 192.168.3.210 ' identified by ' backup ';
Grant Replication Slave on * * to ' backup ' @ ' 192.168.3.211 ' identified by ' backup ';
Flush privileges;
2. Copy the data file from 1 to the top of the 2
Mysql-u root-p123-s/usr/local/mysql_p/mysql.sock
Stop slave;
Mysqldump-u root-p123-s/usr/local/mysql_p/mysql.sock Test >test.sql
SCP Test.sql [Email protected]:/root/
Record the main read_master_log_pos file location
Show Slave Status\g
1. Row ***************************
Slave_io_state:
master_host:192.168.3.203
Master_user:backup
master_port:3306
Connect_retry:60
master_log_file:mysql-bin.000021
read_master_log_pos:56669406
3. Recovering from a 1 backup from 2
Mysql-u root-p123-s/usr/local/mysql_p/mysql.sock
Create DATABASE test;
Use test
Source/root/test.sql
Stop slave;
Change Master to
Master_host= ' 192.168.3.203 ', master_user= ' backup ', master_password= ' backup ', master_port=3306,master_log_file= ' mysql-bin.000021 ', master_log_pos=56669406;
Start slave;
4. Operate from 1 server 210
Mysql-u root-p123-s/usr/local/mysql_p/mysql.sock
Start slave;
This article is from the "Chengdu @ Ah-like" blog, please be sure to keep this source http://azhuang.blog.51cto.com/9176790/1440202
MySQL Add from library method