MySQL binlog management

  • by

binlogs are used for transactional data between databases and for backup. However they can get big unnessecarily.

this is an example of keeping a record of 1 day at max 100mb:
set the file at:
sudo vi /etc/my.conf.d/mysql-server.cnf

to:

expire_logs_days = 1
max_binlog_size = 100M

then run mysql restart:
sudo systemctl restart mysqld