Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In MySQL 5.6, you would want to show what your expire_logs_days is set to first. Then confirm that the master doesnt need to keep these logs more than x amount of days. Word of caution, having binary logs that low in days can be a big risk.
- Set globally as:
- mysql> show variables like 'expire_logs_days';
- +------------------+-------+
- | Variable_name | Value |
- +------------------+-------+
- | expire_logs_days | 5 |
- +------------------+-------+
- 1 row in set (0.00 sec)
- mysql> set global expire_logs_days=1;
- Query OK, 0 rows affected (0.62 sec)
- mysql> show variables like 'expire_logs_days';
- +------------------+-------+
- | Variable_name | Value |
- +------------------+-------+
- | expire_logs_days | 1 |
- +------------------+-------+
- 1 row in set (0.00 sec)
- Then dont forget to update the my.cnf file if you want this setting to remain or survive a service restart:
- $ sudo vim /etc/mysql/my.cnf
- expire_logs_days = 1
- Then flush the current log and to have the binary log statement to take effect on all the logs older than 1 day, in your case:
- mysql> flush binary logs;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement