debugsqlModerate
Error 1236 - "Could not find first log file name in binary log index file"
Viewed 0 times
errorfilelogcouldfirstnamebinaryfind1236index
Problem
Our setup:
Replication was working fine until recently at which point the slave's DBs had to be restored from a dump. I performed all of the necessary steps: Dump the master's DBs, transfer the dump to the slave, drop the old DBs, execute the dump to restore the DBs, execute the appropriate
I am receiving the error:
The first log file that the slave needs from the master is
I can also see that the binary log index on the master seems to have an entry for this log file:
Still replication is not working - I keep getting the same error. I'm out of ideas - what should I check next?
Updated: Output of
```
MariaDB [(none)]> SHOW SLAVE STATUS\G
--------------
SHOW SLAVE STATUS
--------------
1. row
Slave_IO_State:
Master_Host: 127.0.0.1
Master_User: replication
Master_Port: 1234
Connect_Retry: 60
Master_Log_File: mysql-bin.000289
Read_Master_Log_Pos: 342
Relay_Log_File: mysqld-relay-bin.000002
Relay_Log_Pos: 4
Relay_Master_Log_File: mysql-bin.000289
Slave_IO_Running: No
Slave_SQL_Running: Yes
Replicate_Do_DB: xxx_yyy,xxx_zzz
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 342
Relay_Log_Space: 248
Until_Condition: None
- Master: MariaDB 10.0.21
- Slave: MariaDB 10.0.17
Replication was working fine until recently at which point the slave's DBs had to be restored from a dump. I performed all of the necessary steps: Dump the master's DBs, transfer the dump to the slave, drop the old DBs, execute the dump to restore the DBs, execute the appropriate
CHANGE MASTER command, and finally START SLAVE.I am receiving the error:
Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'The first log file that the slave needs from the master is
mysql-bin.000289. I can see that this is present on the master:I can also see that the binary log index on the master seems to have an entry for this log file:
Still replication is not working - I keep getting the same error. I'm out of ideas - what should I check next?
Updated: Output of
SHOW SLAVE STATUS\G as requested:```
MariaDB [(none)]> SHOW SLAVE STATUS\G
--------------
SHOW SLAVE STATUS
--------------
1. row
Slave_IO_State:
Master_Host: 127.0.0.1
Master_User: replication
Master_Port: 1234
Connect_Retry: 60
Master_Log_File: mysql-bin.000289
Read_Master_Log_Pos: 342
Relay_Log_File: mysqld-relay-bin.000002
Relay_Log_Pos: 4
Relay_Master_Log_File: mysql-bin.000289
Slave_IO_Running: No
Slave_SQL_Running: Yes
Replicate_Do_DB: xxx_yyy,xxx_zzz
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 342
Relay_Log_Space: 248
Until_Condition: None
Solution
If all else fails, you may find that you need to reset the slave and restart replication. From https://www.redips.net/mysql/replication-slave-relay-log-corrupted/ :
# First note current settings (note Relay_Master_Log_File and Exec_Master_Log_Pos)
mysql> show slave status\G
# then stop slave
mysql> stop slave;
# make slave forget its replication position in the master's binary log
mysql> reset slave;
# change slave to start reading from stopped position
mysql> change master to master_log_file='mysql-bin.XXX', master_log_pos=XXX;
# start slave
mysql> start slave;Code Snippets
# First note current settings (note Relay_Master_Log_File and Exec_Master_Log_Pos)
mysql> show slave status\G
# then stop slave
mysql> stop slave;
# make slave forget its replication position in the master's binary log
mysql> reset slave;
# change slave to start reading from stopped position
mysql> change master to master_log_file='mysql-bin.XXX', master_log_pos=XXX;
# start slave
mysql> start slave;Context
StackExchange Database Administrators Q#139131, answer score: 12
Revisions (0)
No revisions yet.