MySQL 5.6主从Slave_IO_Runni…

刚配置的MySQL主从,在从机上看到

点击(此处)折叠或打开

  1. mysql> SHOW slave STATUS \\G
  2. *************************** 1. row ***************************
  3.                Slave_IO_State: Connecting to master
  4.                   Master_Host: 172.17.210.199
  5.                   Master_User: my
  6.                   Master_Port: 3306
  7.                 Connect_Retry: 60
  8.               Master_Log_File: masters-bin.000003
  9.           Read_Master_Log_Pos: 1224
  10.                Relay_Log_File: testmysql-relay-bin.000001
  11.                 Relay_Log_Pos: 4
  12.         Relay_Master_Log_File: masters-bin.000003
  13.              Slave_IO_Running: Connecting
  14.             Slave_SQL_Running: Yes
  15.               Replicate_Do_DB: 
  16.           Replicate_Ignore_DB:
  • 看日志有很多:
  • 点击(此处)折叠或打开

    1. 141010 0:02:48 [ERROR] Slave I/O: error connecting to master \'my@172.17.210.199:3306\' - retry-time: 60 retries: 1, Error_code: 2003
    2. 141010 0:03:48 [ERROR] Slave I/O: error connecting to master \'my@172.17.210.199:3306\' - retry-time: 60 retries: 2, Error_code: 2003
    3. 141010 0:04:48 [ERROR] Slave I/O: error connecting to master \'my@172.17.210.199:3306\' - retry-time: 60 retries: 3, Error_code: 2003
    4. 141010 0:05:48 [ERROR] Slave I/O: error connecting to master \'my@172.17.210.199:3306\' - retry-time: 60 retries: 4, Error_code: 2003
    5. 141010 0:06:48 [ERROR] Slave I/O: error connecting to master \'my@172.17.210.199:3306\' - retry-time: 60 retries: 5, Error_code: 2003
    6. 141010 0:07:48 [ERROR] Slave I/O: error connecting to master \'my@172.17.210.199:3306\' - retry-time: 60 retries: 6, Error_code: 2003
    1. 解决方法:  
    2.   
    3. 导致lave_IO_Running 为connecting 的原因主要有以下 个方面:  
    4.   
    5. 1、网络不通  
    6. 2、密码不对  
    7. 3、pos不对
    8. 解决步骤:
    9. 1、对于第一个问题,一般情况下都是可以排除的,也是最容易排除的。
    10. 2、在主库上修改用来复制的用户的密码。
    11. 3、 在做chang to 的时候注意log_pos 是否跟此时主机的一样。在主机上 show master status \G ;可以查看到

    mysql> show master status \G;
    *************************** 1. row ***************************
                 File: masters-bin.000003
             Position: 2392
         Binlog_Do_DB: 
     Binlog_Ignore_DB: 
    Executed_Gtid_Set: 
    1 row in set (0.00 sec)

    ERROR: 
    No query specified

    从机上面执行change to 的正确
    CHANGE MASTER TO 
    MASTER_HOST='172.17.210.199', 
    MASTER_USER='my', 
    MASTER_PASSWORD='123456', 
    MASTER_LOG_FILE='masters-bin.000003', 
    MASTER_LOG_POS= 2392;

    我的问题,就是主机的防火墙没有关闭,犯了一个低级错误!!!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值