MySQL Forums
Forum List  »  Replication

Re: Deleting replication log files?
Posted by: Partha Dutta
Date: September 12, 2005 02:52PM

b_peterson wrote:
> I just got replication working in a master/slave
> model. I notice on my master's database
> directory, it has a bunch of replication log
> files. Do these get auto-deleted by the server?
> Or are we supposed to manually go in and delete
> the old unneeded ones after time?

I am assuming you are talking about the binary logs on the master, and not the relay logs on the slave. By default, the binary logs stay around and are not deleted. This is done just in case you need to replay the binary log, or are needed for soem sort of backup scheme.

To find out which logs can be safely removed from the master, you need to issue a SHOW SLAVE STATUS command on the slave, and note the 'Master_Log_File' value. This shows the current log fiole the slave's I/O thread is reading. You can then use this value to safely remove the files from the master using the 'PURGE MASTER LOGS TO 'log_name' command, using the value from ther SHOW SLAVE STATUS command.

Partha Dutta
Senior Consultant, MySQL Inc.

Options: ReplyQuote

Written By
August 30, 2005 05:53PM
Re: Deleting replication log files?
September 12, 2005 02:52PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.