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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
richie7tech
Posts: 14
Joined: Mon Sep 28, 2020 7:29 am

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

Post 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
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

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

Post 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
richie7tech
Posts: 14
Joined: Mon Sep 28, 2020 7:29 am

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

Post 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
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

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

Post 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
Locked