Mysql Tip: Use expire_logs_days

by matt

I’m not sure if this is common knowledge, but today I went to my site to find the dreaded Error Establishing Database Connection message. A quick look at the mysqld.err log said that there was no space to write the .bin file and that it was waiting for someone to free up some space. I promptly deleted the extra bin files (which dated back to mid 2009) and was back up. A quick google search netted the expire_logs_days key in the config. It’s simple just give it a number of days to keep old logs and it will auto delete those pesky old bins. I used 60 days for no reason in particular, but you can make a more informed decision if you wish.