Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it safe to delete replication relay-bin files?

Tags:

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?

like image 290
HyderA Avatar asked Jan 25 '11 16:01

HyderA


People also ask

Can I delete MySQL relay BIN files?

Mysql doesn't really store the binaries on the replica side, hence it is safe to delete the relay-bin files.

Is it safe to delete Binlog?

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.

What is relay bin in MySQL?

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.

What are MySQL-bin files?

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.


1 Answers

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.

like image 192
Rodo Avatar answered Sep 30 '22 02:09

Rodo