In a MySQL replication environment where replication is done with binary logs, if you run PURGE BINARY LOGS on the master, the server will not delete logs that are currently being replicated by a slave according to the documentation:

This statement is safe to run while slaves are replicating. You need not stop them. If you have an active slave that currently is reading one of the log files you are trying to delete, this statement does not delete the log file that is in use or any log files later than that one, but it deletes any earlier log files.

I couldn't find however any description of whether or not the log purging done by setting the expire_logs_days variable has the same behaviour, e.g. it will not touch logs that are currently being replicated.

Can anyone tell me if the two are equivalent?

  • Good question; hope you get an answer.
    – Rick James
    Commented Jun 23, 2019 at 4:50


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.