The binary log is a set of files that contain information about data modifications made by the MySQL server. These files are generated on master server while bin log is enabled. Over the time the number of those bin log files grows and need to clean on regular basic. Purge binary log will delete binary logs on basic of the give values so It is recommended to backup those binary log files into tape or external drives for future.
PURGE BINARY LOGS
{ TO 'log_name' | BEFORE datetime_expr };
PURGE BINARY LOGS TO 'master-bin.010';
PURGE BINARY LOGS BEFORE '2016-01-01 00:00:00';
Deletes all binary log that are created before January 1st 2016.
We can purge binary on basic of log_name or date before expression.
PURGE BINARY LOGS{ TO 'log_name' | BEFORE datetime_expr };
PURGE BINARY LOGS TO 'master-bin.010';
Deletes all binary log that are created before master-bin.010.
PURGE BINARY LOGS BEFORE '2016-01-01 00:00:00';
Deletes all binary log that are created before January 1st 2016.
No comments:
Post a Comment