排障——数据库主从复制ERROR 3021 (HY000): This operation cannot be performed with a running slave io thread

故障起因

停止一台从服务器后换上了一台新的mysql从服务器

mysql> change master to master_host='20.0.0.12',
	-> master_user='myslave',
	-> master_password='123456',
	-> master_log_file='master-bin.000002',
	-> master_log_pos=154;
ERROR 3021 (HY000): This operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '' first.

解决故障

io线程开启中无法对从服务器进行修改,因此我们需要关闭io线程

mysql> STOP SLAVE IO_THREAD;   //关闭线程
Query OK, 0 rows affected (0.00 sec)

mysql> change master to master_host='20.0.0.12',   //指定主服务器
    -> master_user='myslave',                 //管理用户名称
    -> master_password='123456',              //密码
    -> master_log_file='master-bin.000002',   //二进制文件
    -> master_log_pos=154;                    //文件位置参数

Query OK, 0 rows affected, 2 warnings (0.00 sec)    //提示成功

mysql> start SLAVE IO_THREAD;     //开启io线程
Query OK, 0 rows affected (0.01 sec)

  • 7
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值