On my Linux servers, when I run the script (/etc/init.d/mysql), it defines
CONF=/etc/mysql/my.cnf
which it uses to run the MySQL daemon
EDIT:
also works
mysqld --verbose --help
shows the following information:
Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
So, if you run as a daemon through an init script, it will look for /etc/mysql/my.cnf, and if it is launched from the command line, it will look there only in the second attempt.
source share