Code: Select all
# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin
Or, if I want to keep these binary logs, I can set up a purge rule in MySQL. There are 2 ways to make it:
1. Purge themmanually from MySQL command line:
Code: Select all
PURGE BINARY LOGS TO 'mysql-bin.000403';
PURGE BINARY LOGS BEFORE '2008-04-02 22:46:26';
Code: Select all
mysql> SET GLOBAL expire_logs_days = 7;
Code: Select all
expire_logs_days = 7
1. GLOBAL
Code: Select all
mysql> show global variables like 'expire%';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| expire_logs_days | 7 |
+------------------+-------+
1 row in set (0.00 sec)
Code: Select all
mysql> show session variables like 'expire%';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| expire_logs_days | 7 |
+------------------+-------+
1 row in set (0.00 sec)