MySQL DBA - Tips and Techniques Magazine

13 Nov 2014

Deleting master logs older than one day in a single command

mysql -uroot –p*** -e 'show master logs; purge master logs before date_sub(now(), interval 1 day); show master logs;' 



sample output

 

 

+------------------+------------+

| Log_name         | File_size  |

+------------------+------------+

| mysql-bin.000325 | 1073741878 |

| mysql-bin.000326 | 532809491  |

+------------------+------------+

+------------------+------------+

| Log_name         | File_size  |

+------------------+------------+

| mysql-bin.000326 | 532809491  |

+------------------+------------+

 

 

No comments:

Post a comment