If you ever find yourself in need to adjust some MySQL settings and you're running a MAMP server on Mac OS X, you can always create a my.cnf file using the following command:
sudo cp /Applications/MAMP/Library/share/mysql/my-medium.cnf /Applications/MAMP/Library/my.cnf
You now have created your own my.cnf file where you can adjust some settings. Please make sure restart your MySQL instance after altering the configuration.
You have a few other starting point for creating a my.cnf file. MAMP ships with 5 configuration files for some typical settings. The filenames should be self explanatory:
./Library/share/mysql/my-huge.cnf
./Library/share/mysql/my-innodb-heavy-4G.cnf
./Library/share/mysql/my-large.cnf
./Library/share/mysql/my-medium.cnf
./Library/share/mysql/my-small.cnf
Update: Beware: The my.cnf file might enable binary logging. This may create huge log files (gigabytes). Check out webchick's post how to disable mysql binary logging.
Comments
I found out a plain cp would work no need to sudoing, sounds weird.
I've found something important after taking some time trying your solution without success.
To change configuration files in Mamp, you should go to file> edit template>my.cnf
Otherwise the manual changes to the files are not taken into account.
@webchick... Damn, knew this already (had to find out the hard way too) but forgot to document this here. Well, that's fixed now. I updated my post with a link to your article. Thx!
Warning! I found this out the hard way. :)
If you copy anything bigger than my-small.cnf in, this line will be uncommented:
log-bin=mysql-bin
This turns on "binary logging" which means that MySQL will proceed to "helpfully" log every. single. insert/update/delete/create/etc. query you do. This is wonderful if you're running your own MySQL master/slave replication set-up, but not very useful if you're on a laptop running MAMP. :P
I started getting out of disk messages lately, and was down to ~200MB (!) today, and discovered it was because I had accumulated 58 GB (!) of these log files over the course of the past year.
So... yeah. You might want to watch for that and comment that line out if you don't need it (which you probably don't).
Thanks for the blog post, though! It was great help to me a year ago when I was trying to figure out where the @*^# MAMP wanted my.cnf. :)
This is just what I was looking for, very helpful thank you.
Hi manam
Just open those files and read into them you ll find the info you are looking for (memory etc)
Correct. I've noticed this recently too.
Thank you for this article. It was a good start.
But I've passed a lot of time to try to configure MAMP to have enough "max_allowed_packet", without success.
Finally, the only information I need was to put the new my.cng file under /Applications/MAMP/Library, and it works.
what different between these files
my-huge.cnf
my-innodb-heavy-4G.cnf
my-large.cnf
my-medium.cnf
my-small.cnf
note : i search for it in the internet but all only said that the different is in the performance of system it install in them but i don't understand which system performance want my-huge.cnf and which one want my-small.cnf
Thank you!
Great - this small article was just what I needed. Thanks for posting!
Post new comment