Slave_IO_Running: Yes
Slave_SQL_Running: No
一、数据相差不大
直接跳过一步
stop slave;
set global sql_slave_skip_counter =1;
start slave;
二、数据相差很大,需要重新做主从同步
1,先锁表
mysql> flush tables with read lock;
2,备份数据
mysqldump -uroot -p123456 --all-databases > /tmp/mysql.bak.sql
3,传输数据库到从
scp /tmp/mysql.bak.sql 192.168.65.129:/tmp/
4,导入数据库
系统命令:mysql -uroot -p123456 < /tmp/mysql.bak.sql
或者在MySQL里:
stop slave;
mysql> source /tmp/mysql.bak.sql;
5,设置从库同步change master, File| Position|两项
mysql> change master to master_host = '192.168.65.128', master_user = 'repl', master_port=3306, master_password='123456', master_log_file = 'alex.000001', master_log_pos=410;
6,重新开启从同步
start slave
7,查看同步状态
mysql> show slave status\G
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
同步完成。
原文地址:http://blog.51cto.com/11530642/2095205