当前位置:   article > 正文

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

3021 (hy000): this operation cannot be performed with a running slave io thr

故障起因

停止一台从服务器后换上了一台新的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.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

解决故障

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)

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/160457
推荐阅读
相关标签
  

闽ICP备14008679号