What config file is MySQL using?

from the Artful MySQL Tips List


Mysqld reads my.cnf files found in this order ...
A defaults-file server cmd option overrides all those. This ...
mysqld --help --verbose 
... will tell you where mysqld is looking, and ...
locate my.cnf
... will show all existing my.cnf files, and ...
ps aux | grep mysqld
...may show the defaults-file argument.

Note your my.cnf may start with something like ...

# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/


Open the services applet (eg Start | Run | services.msc), scroll down to the MySQL service, click on Properties, and check the value of the --defaults-file option.

Last updated 26 Apr 2020

Return to the Artful MySQL Tips page