Page 1 of 1

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

Posted: Thu Mar 26, 2015 3:52 am
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.

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

Posted: Thu Mar 26, 2015 9:26 am
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

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

Posted: Thu Mar 26, 2015 9:28 am
by ssax
But do not delete them by hand, you need to use the mysql query to do it.

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

Posted: Tue Apr 14, 2015 11:01 pm
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.

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

Posted: Wed Apr 15, 2015 7:37 am
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.