May 2005
Intermediate to advanced
352 pages
14h 39m
English
PURGE MASTER LOGS
PURGE {MASTER|BINARY} LOGS {TO 'filename'|BEFORE 'date'}Use this statement to delete the
binary logs from a master server. The keywords
MASTER and BINARY are
synonymous and one is required for the statement. Log files are
deleted sequentially from the starting logfile to the one named with
the TO clause, or up until (but not including) the
date named with the BEFORE clause. Here is an
example of each method:
PURGE MASTER LOGS TO 'log-bin.00110'; PURGE MASTER LOGS BEFORE '2004-11-03 07:00:00';
Use the
SHOW MASTER LOGS statement to obtain a list of
logfiles before purging. When using slave servers, run the
SHOW SLAVE LOGS statement on each slave to
determine the oldest log that is still in use before deciding which
logfiles to delete. It would also be prudent to make a backup of the
logs before running this statement.
Read now
Unlock full access