MySQL Replication fix after server shutdown/start
- by Jagbir
Server1 is Master
Server2 is Slave
Both are in our AWS testing env and we stop them once done with our work. When start again, Master rotates/creates new binary log file but slave keep looking for same/existing one and replication stops. Right now, I'm manually repairing it by (slave):
stop slave;
CHANGE MASTER TO MASTER_HOST='xx', MASTER_USER='xxx', MASTER_PASSWORD='xxx' , MASTER_LOG_FILE='new-mysql-bin.00000x',MASTER_LOG_POS=107;
start slave;
show slave status\G
and slave becomes good again.Mysql is 5.5.x on Ubuntu 12.04. Will appreciate any help in automating it.