Bug 235626 - mysqld start script prevents processing of option files
mysqld start script prevents processing of option files
Status: CLOSED DUPLICATE of bug 233771
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: mysql (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: Tom Lane
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2007-04-08 11:01 EDT by monty
Modified: 2013-07-02 23:12 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-04-08 19:33:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description monty 2007-04-08 11:01:38 EDT
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):

How reproducible:

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
Actual results:
None of the options specified in /var/lib/mysql/my.cnf appear in the output of show variables

Expected results:
The options specified in /var/lib/mysql/my.cnf should appear in the output of show variables

Additional info:
MySQL documentation about the processing of option files can be found at http://dev.mysql.com/doc/
Comment 1 Tom Lane 2007-04-08 19:33:48 EDT
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 ***
Comment 2 monty 2007-04-08 19:53:55 EDT
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 
in /etc/my.cnf

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

Comment 3 monty 2007-04-09 00:41:49 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.