Modifying MAMP's my.cnf

By Paulus, 4 May, 2013

MAMP is a great tool that makes it easy to setup a local development environment on a Mac. Most of the time you can set it up and start developing. As the development site you are working on grows, it may be necessary to make changes to the my.cnf file. Out of the box, there is no my.cnf file, which doesn't prevent mysql from working as they are using the minimal default options. MAMP, as well as the vanilla distribution of MySQL provides some sample configuration files. Using one of the example files may address your needs, but all will give you a starting point:

$ sudo su
# cd /Applications/MAMP
./Library/support-files/my-huge.cnf
./Library/support-files/my-innodb-heavy-4G.cnf
./Library/support-files/my-large.cnf
./Library/support-files/my-medium.cnf
./Library/support-files/my-small.cnf
After choosing a configuration to use, the next step is to copy it to one of several locations:
 
# /Applications/MAMP/Library/bin/mysql --help | grep cnf

Default options are read from the following files in the given order:

  1. /etc/my.cnf
  2. /etc/mysql/my.cnf
  3. /Applications/MAMP/conf/my.cnf
  4. ~/.my.cnf 

The above output has been cleaned up for readability. Using the my-huge.cnf configuration file and /etc/my.cnf location as an example:

# cp /Applications/MAMP/Library/support-files/my-huge.cnf /etc/my.cnf

Make any modifications to the configuration file in the new location and restart MAMP.