MySQL从库报错Error_code_MySQL从库报错Slave I/O for channel ”: Got fatal error 1236 from master when reading ...

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

404a8753ed3d6c4616b674a96b72f0ed.png

今天在查看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

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值