If you enable logging of all queries as "slow queries" using the patch or MySQL 5.1 you can get log file to grow huge. Same may happen with general log file. In some cases we've got log file sizes of 100G or more which may need to be cleaned up.
Here is some danger waiting for you at least on typical Linux systems - If you follow most simple process - delete log file you do not need and run "FLUSH LOGS" so file is recreated and space reclaimed you can get into serious trouble. File close operation will when perform deletion which can be quite a long process, depending on filesystem and log file size - we've seen it to take 10 minutes or more in some cases. When log file is reopened MySQL will be practically unavailable causing unanticipated downtime.
The workaround for this problem is very simple - instead of deleting …
[Read more]