Determine which MySQL configuration file is being used

yalestar picture yalestar · Feb 24, 2009 · Viewed 197.8k times · Source

Is there a command to determine which configuration file MySQL 5.0 is currently using?

Answer

Mark B picture Mark B · May 24, 2010

Taken from the fantastic "High Performance MySQL" O'Reilly book:

$ which mysqld
/usr/sbin/mysqld

$ /usr/sbin/mysqld --verbose --help | grep -A 1 "Default options"
Default options are read from the following files in the given order:
/etc/mysql/my.cnf ~/.my.cnf /usr/etc/my.cnf