zoukankan      html  css  js  c++  java
  • MySQL主从配置This operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '' first.

    MySQL主从配置This operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '' first.

    报错界面:

    摆错内容:

    ERROR 3021 (HY000): This operation cannot be performed with a running slave io thread; run STOP SLAVE IO_THREAD FOR CHANNEL '' first.
    

    解决办法:

    1.先关闭当前的slave;

    mysql> stop slave;
    

    2.检查主服务器的配置信息:

    vi /etc/my.cnf
    # 文件末尾查看追加
    log-bin=master-bin 
    binlog-format=ROW 
    server-id=1		   
    binlog-do-db=msb   
    

    3.查看主的状态信息,在主MySQL下:

    mysql> show master status;
    +-------------------+----------+--------------+------------------+-------------------+
    | File              | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
    +-------------------+----------+--------------+------------------+-------------------+
    | master-bin.000009 |      154 | msb          |                  |                   |
    +-------------------+----------+--------------+------------------+-------------------+
    1 row in set (0.00 sec)
    

    记住Position,完成后重新关联:

    change master to master_host='192.168.182.111',master_user='root',master_password='123456',master_port=3306,master_log_file='master-bin.000001',master_log_pos=154;
    

    查看slave状态:

    发现Slave_SQL_Running: No,这地方必须是两个yes才可以同步。

    执行:

    STOP SLAVE;
    SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; 
    START SLAVE;
    

    再查看slave状态:

    slave_sql_running和Slave_IO_Running,分别负责slave mysql进程和与主机的io通信全部是yes,成功!

  • 相关阅读:
    .net 用户控件ascx.cs注册js脚本代码无效果
    Sql-exec
    C# 复制指定节点的所有子孙节点到新建的节点下
    C# 拷贝指定文件夹下的所有文件及其文件夹到指定目录
    svn 命令
    C语言运算符优先级
    两级宏&&字符串化宏
    [C++]#if !defined 的作用
    四面体ply格式文件图和数据对应关系分析
    PLY格式介绍
  • 原文地址:https://www.cnblogs.com/Courage129/p/14169251.html
Copyright © 2011-2022 走看看