Once you have installed MySQL onto OS X / OS X server, MySQL will basically run OK under a light load. You can see what tweaks you might need to make with a fine tuning MySQL script aptly named mysqltuner.pl, this script can make suggestions that you need to load into your MySQL configuration file.
my.cnf
To change some variables to the database server you have to edit configuration file ‘my.cnf’ which you will notice that there isn’t one filed in the root directory /etc. This is the default behaviour as a part of the OS X installation and MySQL runs Ok without it.
The actual MySQL data is stored at:
/usr/local/mysql/data
Some sample my.cnf configuration files for MySQL 5.5.X are found at :
/usr/local/mysql/support-files/
Named my-small.cnf my-medium.cnf my-large.cnfand my-huge.cnf files – if you want your own my.cnf for mysql file that you need to edit, pick the one that suits your environment and make a copy of it into /etc
sudo cp /usr/local/mysql/support-files/my-small.cnf /etc/my.cnf
If you have MySQL 5.6.X ,the default my.cnf is found at:
/usr/local/mysql/my.cnf
Copy that to /etc
sudo cp /usr/local/mysql/my.cnf /etc/my.cnf
Make your adjustments to it and restart MySQL
sudo /usr/local/mysql/support-files/mysql.server restart
Run the mysql tuner script
To make recommended adjustments let the database run for over 24 hrs before running the script.
Then download and run mysqltuner.pl script:
sudo -s
cd /usr/bin/
sudo curl -O https://raw.github.com/major/MySQLTuner-perl/master/mysqltuner.pl
sudo chmod 755 mysqltuner.pl
Run the Script and Look for the Recommendations
mysqltuner.pl
The important output returned to you is in the ‘Variables to Adjust’ section…
Take these recommendations and add/adjust them into your /etc/my.cnf file
Restart MySQL for these settings to take affect
sudo /usr/local/mysql/support-files/mysql.server restart