主db服务器 M
从db服务器 S
M
1.mysqldump -u -h db table1,table2.. > db1.sql
2.scp db1.sql S(host):80
3.master stop
4.show mastet status
5.记录
FILE:mysql-bin.000010
Position:20461927
Binlog_Do_DB
Binlog-lngore_DB
S
1.mysql -u -h db < db1.sql
2.slave stop
3.show slave status
4.设置master ip
change master to master_host = '192.168.1.224'
5.change master to master_log_file = 'mysql-bin.000010' master_log_Pos=20461927;
6.slave start
若有冲突
slave stop
show variables like %counter%
set global sql_slave_skip_counter = 1;
slave start
show slave status;
还有 重复上述解决冲突的步骤
转载于:https://blog.51cto.com/4323053/766396