Skip to Content
MySQL 8 Cookbook
book

MySQL 8 Cookbook

by Karthik Appigatla
January 2018
Intermediate to advanced
446 pages
12h 57m
English
Packt Publishing
Content preview from MySQL 8 Cookbook

Expire binary logs

Binary logs consume a lot of space based on the number of writes. Leaving them as-is can fill up the disk in no time. It is essential to clean them up:

  1. Set the expiry of logs using binlog_expire_logs_seconds and expire_logs_days.If you want to set an expiry period in days, set expire_logs_days. For example, if you want to delete all the binary logs that are older than two days, SET @@global.expire_logs_days=2. Setting the value to 0 disables automatic expiry. If you want to have more granularity, you can use the binlog_expire_logs_seconds variable, which sets the binary log expiration period in seconds. The effects of this variable and expire_logs_days are cumulative. For example, if expire_logs_days is 1 and binlog_expire_logs_seconds ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

MySQL Cookbook

MySQL Cookbook

Paul DuBois
Advanced MySQL 8

Advanced MySQL 8

Eric Vanier, Birju Shah, Tejaswi Malepati

Publisher Resources

ISBN: 9781788395809Other