HiveBrain v1.2.0
Get Started
← Back to all entries
debugsqlModerate

Broken mysql replication on slave server (error 1236)

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
1236errorslavebrokenreplicationmysqlserver

Problem

My question is: how to fix broken mysql replication on slave server (error 1236)?

server 1 (192.168.1.105)
server 2 (192.168.1.106)

I ran these steps to re-sync:

At the master - server 1 (192.168.1.105):

mysql -u root -p


  • RESET MASTER;



  • FLUSH TABLES WITH READ LOCK;



  • SHOW MASTER STATUS;



  • Note > File: mysql-bin.000001 and Position: 107



  • mysqldump -uroot -p --events --ignore-table=mysql.events --all-databases > /var/backups/mysqldump.sql



  • UNLOCK TABLES;



  • Copy mysql dump file to server 2



(scp -p /var/backups/mysqldump.sql root@192.168.1.106:/tmp)

At the slave server 1 (192.168.1.106):

  • STOP SLAVE;



  • `mysql -uroot -p



  • RESET SLAVE;



  • CHANGE MASTER TO MASTER_HOST='192.168.1.105', MASTER_USER='slaveuser', MASTER_PASSWORD='mypassword';



  • CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=107;



  • START SLAVE;



I still got this error on server 1


Last_IO_Errno: 1236 Last_IO_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'

Solution

I believe the log file and position need to be specified with the host.

Try:

CHANGE MASTER TO MASTER_HOST='192.168.1.105', MASTER_USER='slaveuser', MASTER_PASSWORD='mypassword', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=107;

Code Snippets

CHANGE MASTER TO MASTER_HOST='192.168.1.105', MASTER_USER='slaveuser', MASTER_PASSWORD='mypassword', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=107;

Context

StackExchange Database Administrators Q#46225, answer score: 10

Revisions (0)

No revisions yet.