Mysql 'bin' logs?

This should be a fairly simple question...

I have a huge amount of 'hostname-bin.001' to 'hostname-bin.NNN' style logs in my mysql directory.

My question is,

A: What are these logs good for?
B: If I'm making regular (hourly) backups of my databases anyway via another system, are these useless?
C: Is there a way to turn off these logs?

Many thanks,
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Extracted from
Stop mysqld if it's running, then start it with the --log-bin[=file_name] option. See section 5.9.4 The Binary Log. The binary log files provide you with the information you need to replicate changes to the database that are made subsequent to the point at which you executed mysqldump.

Even if you are doing an hourly backup, the binary log is still important. Every time you do a backup, you should take note of the point of the binary log. Easier to do a FLUSH LOGS and take note of the next binary log filename.

In a crash, after you restore from your backup, you can replay the binary logs after the backup to obtain an up-to-date (till the state before the crash). You will need a backup and the binary logs to do a restore without losing too much data.
If you have the binary logs in a separate disk from your database tables, maybe you do not need to backup as frequent as hourly, maybe daily will do.

Old binary logs of course can be deleted when no longer needed. Just keep the binary log since the previous 2 or 3 backups will be sufficient. Or, you can archive them together with your backup if you want.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
UmeshMySQL Principle Technical Support EngineerCommented:

[Taken from NET & might be identical to above comment..]

The binary log is primarily there to let you restore data. Say you backup
every night at 04:00 and your database crashes at 15:00 you can restore from
your backup but what about all those changes in the 11 hours after the
backup was made?

Instead you can use mysqlbinlog to run all the changes made in those 11
hours and get your data back to pretty much exactly where it was before the

According to the manual, the performance hit is about 1% - that's peanuts in
exchange for the ability to recover your data.

The other function of the binary log is to store statements that will be
replicated on slave servers. That might not be relevant to you at the
moment, but will perhaps be something you need later?

If you really want to disable it, read the manual page at: 

UmeshMySQL Principle Technical Support EngineerCommented:
it was late.. sorry..
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.