DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(mysql.info.gz) PURGE MASTER LOGS

Info Catalog (mysql.info.gz) Replication Master SQL (mysql.info.gz) Replication Master SQL (mysql.info.gz) RESET MASTER
 
 13.6.1.1 `PURGE MASTER LOGS' Syntax
 ...................................
 
      PURGE {MASTER | BINARY} LOGS TO 'LOG_NAME'
      PURGE {MASTER | BINARY} LOGS BEFORE 'DATE'
 
 Deletes all the binary logs listed in the log index that are strictly
 prior to the specified log or date.  The logs also are removed from the
 list recorded in the log index file, so that the given log becomes the
 first.
 
 Example:
 
      PURGE MASTER LOGS TO 'mysql-bin.010';
      PURGE MASTER LOGS BEFORE '2003-04-02 22:46:26';
 
 The `BEFORE' variant is available as of MySQL 4.1. Its date argument
 can be in `'YYYY-MM-DD hh:mm:ss'' format.  `MASTER' and `BINARY' are
 synonyms, but `BINARY' can be used only as of MySQL 4.1.1.
 
 If you have an active slave that currently is reading one of the logs
 you are trying to delete, this statement does nothing and fails with an
 error.  However, if a slave is dormant and you happen to purge one of
 the logs it wants to read, the slave will be unable to replicate once it
 comes up.  The statement is safe to run while slaves are replicating.
 You do not need to stop them.
 
 To purge logs, follow this procedure:
 
   1. On each slave server, use `SHOW SLAVE STATUS' to check which log
      it is reading.
 
   2. Obtain a listing of the logs on the master server with `SHOW
      MASTER LOGS'.
 
   3. Determine the earliest log among all the slaves. This is the
      target log.  If all the slaves are up to date, this will be the
      last log on the list.
 
   4. Make a backup of all the logs you are about to delete.  (The step
      is optional, but a good idea.)
 
   5. Purge all logs up to but not including the target log.
 
Info Catalog (mysql.info.gz) Replication Master SQL (mysql.info.gz) Replication Master SQL (mysql.info.gz) RESET MASTER
automatically generated byinfo2html