• 为什么写博客,是因为遇到的坑,不希望别人在踩一遍!
  • 选择了,剩下的就是坚持和努力-------致自己!
  • 当能力达不到梦想时,更需要学习,努力,拼搏

MySQL从库报错Slave I/O for channel ”: Got fatal error 1236 from master when reading data from binary log: ‘Could not find first log file name in binary log index file’, Error_code: 1236

Mysql 雪豹 6年前 (2018-05-20) 1321次浏览 0个评论

MySQL从库报错Slave I/O for channel ”: Got fatal error 1236 from master when reading data from binary log: ‘Could not find first log file name in binary log index file’, Error_code: 1236

images

今天在查看MySQL 主从 ,从库报错 Slave_IO_Running: No ,查看msyql 错误日志报错:11 [ERROR] Error reading packet from server for channel ”: Could not find first log file name in binary log index file (server_errno=1236)

解决方法:

在master 主库上执行刷新日志

mysql> flush logs;
Query OK, 0 rows affected (0.00 sec)

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

停止从库主从复制,并设置CHANGE

mysql> stop slave;
Query OK, 0 rows affected (0.01 sec)
# 设置
mysql> CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000003',MASTER_LOG_POS=154;
Query OK, 0 rows affected (0.00 sec)
#启动从库
mysql> start slave;
Query OK, 0 rows affected (0.01 sec)

启动从库后检查 主从状态,发现恢复

mysql> show slave status\G
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 172.16.1.6
                  Master_User: rep
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000003
          Read_Master_Log_Pos: 154
               Relay_Log_File: mysql02-relay-bin.000002
                Relay_Log_Pos: 320
        Relay_Master_Log_File: mysql-bin.000003
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes


有需要可以联系微信xuebao19930721和加入微信群
喜欢 (10)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址