whird.jpope.org cover image

MySQL Took Over My Hard Drive

Yeah, so it's probably due to misconfiguration on my part but, I ran across an issue where the MySQL binary logs soaked up 83% of the disk space on my server. Of course, at first I didn't realize that was the issue. After looking through various system logs, I moved on to the MySQL logs since I was having issues shutting down and starting MySQL. In the error log found in /var/lib/mysql, I noted that it said something about not having disk space. Wait a minute, the last time I checked I was using well under 5GB of my 20GB partition on my server. A quick 'df -h' confirmed that my root partition was completely full. :/ So to figure out what was using all of my hard drive space, I used this command that will list any files it finds that is over 50MB. # cd / # find . -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }' And that showed me that over 2 dozen files were in the /var/lib/mysql dir, all with filenames like mysql-bin.000001 mysql-bin.000002 mysql-bin.000003 mysql-bin.000004 ... mysql-bi…