Link to home
Start Free TrialLog in
Avatar of umbrae
umbrae

asked on

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,
-Umbrae
ASKER CERTIFIED SOLUTION
Avatar of lokus
lokus

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,

[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
crash.


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:


http://dev.mysql.com/doc/mysql/en/Binary_log.html 


it was late.. sorry..