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?
Mysql doesn't really store the binaries on the replica side, hence it is safe to delete the relay-bin files.
1 Answer. Save this answer. Show activity on this post. When you don't need them anymore, then yes, it's safe to delete them.
The relay log, like the binary log, consists of a set of numbered files containing events that describe database changes, and an index file that contains the names of all used relay log files. The term “relay log file” generally denotes an individual numbered file containing database events.
The mysql-bin files are the binary logs, which are typically both for either a transaction history or for the purpose of replication. To disable binary logging, you can comment the log-bin* lines in the cnf. log-slave-updates should be commented too if enabled.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With