On Tue, 9 Dec 2003, Mayuran Yogarajah wrote: > Diana Soares wrote: > > >Use "PURGE {MASTER|BINARY} LOGS TO 'log_name'" instead of "RESET > >MASTER". > >>From the manual: > > > >" > >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 this > >list recorded in the log index file, so that the given log now becomes > >the first. > >(...) > >You must first check all the slaves with SHOW SLAVE STATUS to see which > >log they are reading, then do a listing of the logs on the master with > >SHOW MASTER LOGS, find the earliest log among all the slaves (if all the > >slaves are up to date, this will be the last log on the list), backup > >all the logs you are about to delete (optional) and purge up to the > >target log. > >" > >http://www.mysql.com/doc/en/PURGE_MASTER_LOGS.html > > > > > > > > That worked quite nicely, thank you :) Is there some reason why > MySQL keeps these log files ? Why wouldn't it delete them as a > new one got created? > > thanks >
You can also use those to restore a database that is lost somehow. Just run all the binary logs and pipe them into mysql from the last "snapshot" you have taken a backup from. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]