Is it safe to delete replication relay-bin files?

HyderA picture HyderA · Jan 25, 2011 · Viewed 42k times · Source

I've got a small database, around 50mb. It's a master replicating to a remote server. I noticed that the relay-bin files total to over 5GB. Is it safe to delete them?

Answer

Rodo picture Rodo · May 23, 2012

I think a better answer is relay logs can be 'deleted' but mysql should manage it automatically. One way to do this is to check for the value of relay_log_purge.

It should be set to 1 if you want mysql to manage them:

set global relay_log_purge=1;

You would probably need to flush the logs:

flush logs;

This does not affect the binary logs.