« MySQL Cluster not in 5.1.12 Binaries | Main | MySQL Cluster Setup, in a Single Screenshot »

November 19, 2006

How MySQL Loads Configuration Options

A quick refresher on the locations MySQL uses to load up configuration options on Unix:

  1. /etc/my.cnf
  2. $MYSQL_HOME/my.cnf (sometimes this is your datadir, other times it's basedir)
  3. command line arg (defaults-extra-file)
  4. user's home directory (~/user/.my.cnf)

It's available in the MySQL docs, and there's a section on it in Pro MySQL, but it seems a need to remember the exact order only comes often enough to confirm that I haven't committed it to long-term memory.

Posted by mike at November 19, 2006 10:07 PM

Hard Drive Recovery Group offers hard disk data recovery services for RAID, laptops and servers. Complete clean room and hard drive repair service.

Trackback Pings

TrackBack URL for this entry:
http://mike.kruckenberg.com/mt/mt-tb.cgi/955

Comments

Confusingly enough, the distributed mysqld binary from MySQL lists different locations, and a different order:

bash$ /usr/local/mysql/bin/mysqld --help --verbose

... snip ...

Default options are read from the following files in the given order:
/etc/my.cnf ~/.my.cnf /usr/local/mysql/etc/my.cnf

Notice the last file is in $basedir/etc.

Posted by: David Shrewsbury at November 20, 2006 11:11 AM

Post a comment




Remember Me?