Description of problem:
The /etc/init.d/mysqld script uses the "--defaults-file=/etc/my.cnf" option when starting mysql.
MySQL reads that option file by default. Specifying that option is not necessary.
Specifying that option prevents MySQL from looking for and processing other option files as specified in
the MySQL documentation. For example, MySQL will ignore the my.cnf file in /var/lib/mysql/
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Create /var/lib/mysql/my.cnf with various options
2. Start mysqld using /sbin/service mysqld start
3. Run mysql and use the show variables command to look for the options set in /var/lib/mysql/my.cnf
None of the options specified in /var/lib/mysql/my.cnf appear in the output of show variables
The options specified in /var/lib/mysql/my.cnf should appear in the output of show variables
MySQL documentation about the processing of option files can be found at http://dev.mysql.com/doc/
The restriction to /etc/my.cnf is intentional because the script itself examines that file; if mysql were to
look elsewhere then the wrong things would happen.
There is a better way proposed in bug #233771, which I have adopted in CVS HEAD but am unsure when
or if I will get permission to back-patch into RHEL4. In the meantime, this is effectively a duplicate of that
bug and I'm going to mark it as such.
(BTW, surely this is not "high severity". There's no functionality loss from just putting the options into
/etc/my.cnf, is there?)
*** This bug has been marked as a duplicate of 233771 ***
The MySQL documentation specifically states that server specific options should be placed in DATADIR/
my.cnf and that /etc/my.cnf be used for global options. Options in DATADIR/my.cnf override those found
The mysql user/group does not have write permission to /etc/my.cnf
The recent MySQL security update clobbered the /etc/init.d/mysqld file and broke the MySQL functionality
that was controlled by options set in /var/lib/my.cnf
The output of running
my_print_defaults client mysqld
shows that the contents of /var/lib/mysql/my.cnf would be processed by mysqld as expected.
The use of [--defaults-file=/etc/my.cnf"] in /etc/init.d/mysqld breaks the expected behavior.