Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I just install XAMP in my mac and I'm trying to learn by my own, with books, tutorials and you guys. I'm working in the backup part and I saw I have only a LOG "mysql-bin.000001' :

  • What happen when this logs is full??.
  • Will Mysql create another one by it self??.
  • Is it possible to have 3 logs and they will delete by itself when the last one is full, like Oracle db does ?.
  • What are the cons to have more than one log (beside more space)???.
  • I guess that the Engine doesn't matter, right?
share|improve this question
    
thanks for the answer, but what about if I want to add more logs???, if it's automatically, how many logs will be created?, THANKS –  jcho360 Apr 23 '12 at 15:21
add comment

1 Answer

up vote 2 down vote accepted

The mysqld process will rotate to the next log by itself when the current binary log reaches 1G (default is 1G, but you can change that by setting max_binlog_size).

Unless you set the expire_logs_days option (By default, it is 0), no logs will disappear.

Keep in mind that restarting mysql also causes log rotations.

If you want to delete logs manually, DO NOT DELETE THEM IN THE OS.

Please use this command : PURGE BINARY LOGS TO 'mysql-bin.000200';

All logs before mysql-bin.000200 will be deleted.

You could also delete logs by timestamp: PURGE BINARY LOGS BEFORE '2012-04-19 00:00:00';

There are no other drawbacks other than wasted diskspace, especiall if the logs have outlived their usefulness.

Storage Engine usage in independent of Binary Logging. DDL for MyISAM and InnoDB can both recorded in the binary logs.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.