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 < /tmp/mysqldump.sql
- 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'