mysql 组从服装IO线程没起来,出现‘Could not find first log file name in binary log index file‘错误的解决办法

本文介绍了一种解决MySQL从库出现'Slave_IO_Running:No'及'Couldnotfindfirstlogfilenameinbinarylogindexfile'错误的方法。通过在主库上刷新日志并更新从库的配置来恢复正常的数据同步。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

错误

Slave_IO_Running:  No
Last_IO_Error: 'Could not find first log file name in binary log index file'

解决办法:
1.从机器停止slave

mysql> slave stop;

2.在master上刷新日志:

mysql> flush logs;

3.记录新的master的bin的位置:

root@mysql 21:22  mysql>show master status;
+--------------------------+----------+--------------+------------------+------------------------------------------+
| File                     | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set                        |
+--------------------------+----------+--------------+------------------+------------------------------------------+
| mysql-compile-bin.000024 |      194 |              |                  | 6243584b-077b-11eb-9633-000c29ae98d2:1-8 |
+--------------------------+----------+--------------+------------------+------------------------------------------+
1 row in set (0.00 sec)

4.马上到slave执行

mysql> CHANGE MASTER TO MASTER_LOG_FILE='mysql-compile-bin.000024',MASTER_LOG_POS=194;
mysql> slave start;
mysql> show slave status\G;

Slave_IO_Running: Yes
Slave_SQL_Running: Yes

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值