Question

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?
Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top