Location of my.cnf file on macOS

nicolas picture nicolas · May 25, 2012 · Viewed 351k times · Source

I'm trying to follow along this tutorial to enable remote access to MySQL. The problem is, where should my.cnf file be located? I'm using Mac OS X Lion.

Answer

bfavaretto picture bfavaretto · May 25, 2012

This thread on the MySQL forum says:

By default, the OS X installation does not use a my.cnf, and MySQL just uses the default values. To set up your own my.cnf, you could just create a file straight in /etc.

OS X provides example configuration files at /usr/local/mysql/support-files/.

And if you can't find them there, MySQLWorkbench can create them for you by:

  1. Opening a connection
  2. Selecting the 'Options File' under 'INSTANCE' in the menu.
  3. MySQLWorkbench will search for my.cnf and if it can't find it, it'll create it for you