Mar 17
So your binary logs have grown to an ugly size eating up most of your servers disk size? The easiest way to truncate the logs in a proper way is to run the following command:
reset master;
Please note: This command works for MySQL >=5, for older versions use flush master;.
Update: There exists a system variable that would automatically purge binary logs older than a given interval. Excerpt from MySQL documentation:
For the binary log, you can set the expire_logs_days system variable to expire binary log files automatically after a given number of days (see Section 5.1.3, “System Variables”).
July 15th, 2008 at 20:57
Does the purge only work if mysql is restarted? That seems to be the case but I’m not sure if I’m missing something else, like security on the files or something.
July 16th, 2008 at 0:38
Actually the “reset master” command is supposed to work in online mode (aka without restarting it) and it does for me. What does your setup look like?