Saturday, December 10, 2016

remove old mysql binary logs

The binary logs can use lots of storage space. Following are 2 ways to clean them up, by name and by time. 

To remove all binary logs up to mysql-bin.003456:

mysql> PURGE BINARY LOGS TO 'mysql-bin.003456';

To remove all binary logs by date/time (Before December 8th, 2016 @6:00):

mysql> PURGE BINARY LOGS BEFORE '2016-12-08 00:06:00';

Search for MySQL binary logs, error logs, temporary files:

# lsof -nc mysqld | grep -vE '(.so(..*)?$|.frm|.MY?|.ibd|ib_logfile|ibdata|TCP)'

1 comment:

Shalini said...

Great site for these post and i am seeing the most of contents have useful for my Carrier.Thanks to such a useful information.Any information are commands like to share him.

Seo Company in Chennai