Page 1 of 1

mysql binary files -- need to reduce 33G of binlog files

Posted: Thu Jan 06, 2022 11:10 am
by richie7tech
Hello
i'm using nagios xi 5.8.1
my root partition is almost full
on investigation i have approx 30Gigs of mysql binary log files spanning back 1 month

i have tried to follow the document below
https://support.nagios.com/forum/viewto ... ry#p320510

but the file locations are out of date.
trying to find /etc/mycnf.d/ or the file i should be altering



quote from support forum link

The binlog_expire_logs_seconds can be decreased.

Edit the /etc/my.cnf.d/mysql-server.cnf file and add this line to the bottom.
binlog_expire_logs_seconds=86400

To purge the data, run this:

echo "PURGE BINARY LOGS BEFORE '2020-11-05 23:59:59';" |mysql -u root -pnagiosxi


thanks for any help given
richie

Re: mysql binary files -- need to reduce 33G of binlog files

Posted: Thu Jan 06, 2022 5:25 pm
by pbroste
Hello @richie7tech

Thanks for reaching out, sounds like you have done most of the leg work on this one. So to verify I jumped on my Test VM and ran through a search and found it here:

Code: Select all

grep -Eir 'binlog_expire_logs_seconds' /etc/*
The results with the 'etc' path:
/etc/my.cnf.d/mysql-server.cnf:binlog_expire_logs_seconds=86400
Thanks,
Perry

Re: mysql binary files -- need to reduce 33G of binlog files

Posted: Fri Jan 07, 2022 9:27 am
by richie7tech
Many Thanks Perry

i'm using Ubuntu 20.04
using you're search command i found the location

/etc/mysql/mysql.conf.d/mysqld.cnf

and it was set to 2592000
now altered to 86400 = 1 day

again thanks

richie

Re: mysql binary files -- need to reduce 33G of binlog files

Posted: Fri Jan 07, 2022 12:19 pm
by pbroste
Hello @richei7tech

Thanks for the follow-up, and will go ahead to lock this post.

Please let us know if you need anything further,
Perry