About too many mysql binary logs (12gb)

Hi!

Today mysql was working bad, looking at the errorlog I realized that the disk was full…. then I see 12gb of binary logs… (some of them from 4 months ago?)

It is a regular mysql, no slave, no replication, etc… just a regular mysql with 3 databases at the moment…

The question is… How many days we need to keep those binary log files? Why are not purged? Do I need to configure something to achieve that?

Best regards!

luciano

3 Replies

Are you backing up the database? Binary logs also serve to keep a record of what's changed since the last backup so you can do a point in time recovery between backups.

mysqldump can be called to backup the db with options –flush-logs and --delete-master-logs so it prunes back the logs.

If you don't need that, turn the binary logging off in the cnf file by commenting out the log_bin setting

Thanks for the advices vickd!

Will do the backup thing I guess! it was a thing to do… it is time now :)

You can also set up expirelogsdays to clean out logs for you

http://dev.mysql.com/doc/refman/5.0/en/ … _logs_days">http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvarexpirelogs_days

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct