首页 > 数据库技术 > 详细

Mysql 主从同步之Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'问题解决

时间:2021-07-26 14:50:48      阅读:21      评论:0      收藏:0      [点我收藏+]

主从同步出现Got fatal error 1236 from master when reading data from binary log: ‘Could not find first log file name in binary log index file,则是因为主从日志版本号不一致而导致。解决如下:

查看主日志号
 MariaDB [(none)]> Flush logs;  (这时主服务器会重新创建一个binlog文件;)
 MariaDB [(none)]> show master status;
+------------------+----------+--------------+------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000003 |      385 |              |                  |
+------------------+----------+--------------+------------------+
1 row in set (0.000 sec)

 在从中查看slave日志文件号show slave status\G
   File :mysql-bin.000005
发现是因为主从日志文件号不同而导致 
在从中stop slave;
MariaDB [(none)]> change master to master_log_file =dbmaster-bin.000005,master_log_pos=120; 
MariaDB [(none)]> flush privileges; 
MariaDB [(none)]> start slave; 
MariaDB [(none)]> show slave status\G

*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.220.130
Master_User: test
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000003
Read_Master_Log_Pos: 385
Relay_Log_File: mysqld-relay-bin.000002
Relay_Log_Pos: 555
Relay_Master_Log_File: mysql-bin.000003
Slave_IO_Running: Yes
Slave_SQL_Running: Yes

 

Mysql 主从同步之Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'问题解决

原文:https://www.cnblogs.com/alisapine/p/15060864.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!