Skip to Main Content
Abstract-art-background-270456

MAMP Pro for Windows - MySQL Runaway Storage

Mamp Pro for Windows has runaway MySQL logs - here's how to fix that.

I've been running Mamp Pro for Windows for about 2 and half years now and find it a very convenient and simple way to run multiple sites locally. It works great.

However I didn't realize that it was the cause of my C: Drive running out of disk space. I have a relatively large SSD drive of 275gb which had run out of space and I kept having to remove stuff as it continued to fill up any empty space.

The reason it was running out of space is that MySQL runs logs by default and doesn't prune them. the folder with my database had 809 log files of over 100gb of space.

The solution was relatively simple after googling I found this page which gave me the solution.

f you don't need logging then you can turn it off (most don't unless you are replicating):
locate and edit your my.cnf (/etc/my.cnf - but may be somewhere else in WAMP/MAMP/XAMP etc)
locate and comment out the line:

log_bin = /var/log/mysql/mysql-bin.log

You also need to remove or comment following lines:

expire_logs_days = 1
max_binlog_size = 100M

Close and save the file. Finally, restart mysql server

https://www.blue-bag.com

I'm not sure if I need logging or not, but I opened up my.cnf by using the Mamp Pro interface file > edit template > MySQL mysql.ini When I did I not see the expire_logs_days or max_binlog_size anywhere. So I added those lines below log-bin=mysql-bin like this:

    
    
      # Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin
expire_logs_days = 10
max_binlog_size = 500M
    
  

Restart and Done

I then restarted the server and all the bin files except from the past ten days disappeared. IMO these settings should be in the default template that comes with Mamp Pro, but it doesn't. Hope this helps someone else out.