Overview
You got Mariadb replication ERROR 1201 (HY000): Could not initialize master info structure for '';
when running start-slave
after the migration.
Steps:
Check the Current Master Binary Log Position
Login to master server, and run the following:
docker exec mariadb-master show-status
Replication Mode: master
[mysql] *************************** 1. row ***************************
[mysql] File: mysqld-bin.xx
[mysql] Position: xx
[mysql] Binlog_Do_DB:
[mysql] Binlog_Ignore_DB:
############### Connections ###############
Reset and Reconfigure Replication
- On the slave server, stop the slave: STOP SLAVE;
- Reset the replication. RESET SLAVE;
- Correct the Slave’s Log File and Position and Reconfigure the Replication
CHANGE MASTER TO MASTER_HOST='mariadb-master-server'
MASTER_USER='replication-user',
MASTER_PASSWORD='strongpassword',
MASTER_LOG_FILE='mysqld-bin.xx',
MASTER_LOG_POS=xx;
Start the Slave:
START SLAVE;
Check the slave status
SHOW SLAVE STATUS\G;
- Tail the Error Log:
tail -f /var/log/mysql/error.log