Skip to content

Instantly share code, notes, and snippets.

@kzap
Created June 20, 2018 14:39
Show Gist options
  • Save kzap/a4a95c1315b3419c794de9c4c5da7af0 to your computer and use it in GitHub Desktop.
Save kzap/a4a95c1315b3419c794de9c4c5da7af0 to your computer and use it in GitHub Desktop.
How to clean up logs when running MHA on a Master Replica MySQL Setup
# On Master Server purge binary logs up to latest log file
PURGE BINARY LOGS TO 'mysql-bin.010';
# On Slave Servers, clear relay logs
SET GLOBAL relay_log_purge=1;
FLUSH LOGS;
# wait for relay logs to get deleted
SET GLOBAL relay_log_purge=0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment