Location of MySQL's my.cnf fileLocation of MySQL's my.cnf file

Posted November 8th, 2010 in MySql (Updated August 11th, 2011)

MySQL's main configuration file is my.cnf and it is located in different locations depending on the operating system, distribution and version. This post is a quick reference to show where it is located on various different installations. If you have another one to add, please let me know by emailing me or adding to the comments at the end of the post.

CentOS 5 / RHEL 5

For Red Hat Enterprise Linux 5, CentOS 5 and other derived Linux distributions:


Debian 5 Lenny

For Debian 5 Lenny and other derived Linux distros including Ubuntu:


MAMP 1.9 on OSX 10.6

Regular MAMP doesn't have one by default (although apparantly MAMP Pro does) but you can either create one yourself at, or copy one of the my-*.cnf files from /Applications/MAMP/Library/share/mysql as:


MAMP 2.0 on OSX 10.7

As above, and the location is:



I don't know where it is, having never used WAMP myself :)  I suspect the installation path can be set to whatever you want when it's installed but it looks like from the screenshots on the WampServer website that you can probably get to it using the GUI menu anyway.

Thanks to James Butler for emailing me to let me know that on WAMP it's at:


So first look for where WAMP is installed and then the path above.


blog comments powered by Disqus