What kind of file from /var/lib/mysql/ folder

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
phyo
Posts: 162
Joined: Sun Dec 01, 2013 10:50 pm

What kind of file from /var/lib/mysql/ folder

Post by phyo »

Hi,

I found out there are a lot of mysqld-bin.xxxxxx under /var/lib/mysql/ folder. The file name are mysqld-bin.000001 ~ 000499. And most of the file size is 1.1 GB.

How those file are created? I want to know that those are what kind of files? And can we delete? If I can delete, what kind of side effect can be happen?

Thanks.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: What kind of file from /var/lib/mysql/ folder

Post by ssax »

Those are mysql binary log files, you can read more about them and how to manage them here: http://serverfault.com/questions/82093/ ... -to-remove
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: What kind of file from /var/lib/mysql/ folder

Post by ssax »

But do not delete them by hand, you need to use the mysql query to do it.
phyo
Posts: 162
Joined: Sun Dec 01, 2013 10:50 pm

Re: What kind of file from /var/lib/mysql/ folder

Post by phyo »

ssax wrote:Those are mysql binary log files, you can read more about them and how to manage them here: http://serverfault.com/questions/82093/ ... -to-remove
I tried to solve this issue mention in this link.
First I login to mysql and run the following command.

Code: Select all

SET GLOBAL expire_logs_days=7;
But it seems all of the old mysql binary files haven't delete. So I restart the mysqld service. And I noticed SET GLOBAL expire_logs_days become from 7 to 0 after I restart the service.
So I backup the my.cnf file and add the SET GLOBAL expire_logs_days=7 manually. After I restart the msyqld service, all of the old mysql binary file has been deleted.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: What kind of file from /var/lib/mysql/ folder

Post by lmiltchev »

Interesting..., so setting the value directly in mysql didn't work, but setting it in the my.cnf did. In any case, I am glad the issue has been resolved! I am locking this topic.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked