Could not find first log file name in binary log index file

一. 问题背景

搭建mysql主从复制
主机:在window上
从机:在CentOS上

报错:Could not find first log file name in binary log index file

原因: 从机找不到日志文件

二. 解决方案

  1. 在从机上按ctrl+c结束当前进程,输入service mysql restart;
  2. 在主机上输入flush logs;,然后show master status;
    在这里插入图片描述
  3. 在从机上进入mysql,然后stop slave;,然后change master to master_log_file='上图第一个红色圈的值', master_log_pos=第二个红色圈的值;
  4. 在从机上slave start;,然后show slave status\G;
发布了352 篇原创文章 · 获赞 20 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/qq_40634846/article/details/105268257
今日推荐