We have experienced replication failure between primary - secondary databases.
I have tried various scenarios to get replication to work again, which included deleting secondary database and restoring it from primary backup. However, replication still fails.
Would it be best to follow steps:
mysql> STOP SLAVE;
mysql> RESET MASTER; mysql> FLUSH TABLES WITH READ LOCK; mysqldump -u root -p mydb > mydb-dump.sql mysql> UNLOCK TABLES;
mysql -u root -p mydb < mydb-dump.sql mysql> RESET SLAVE; mysql> CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1; mysql> START SLAVE; mysql> show slave status\G
Is it safe to execute
mysql> RESET MASTER; mysql> RESET SLAVE;
as those commands deletes the binary log files. Or would it be better to use
mysql> PURGE BINARY LOGS
Any thoughts would be greatly appreciated.