MySQL5.6主从Slave_IO_Running:Connecting/errorconnectingtomaster*-retry

刚配置的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 的原因主要有以下 3 个方面:  
    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;

    我的问题,就是主机的防火墙没有关闭,犯了一个低级错误!!!!MySQL 5.6主从Slave_IO_Running:Connecting/error connecting to master *- retry


    分享标题:MySQL5.6主从Slave_IO_Running:Connecting/errorconnectingtomaster*-retry
    网页路径:http://ybzwz.com/article/ggdphh.html