Bug #11074 incomplete my.cnf location in "mysql --verbose --help"
Submitted: 3 Jun 2005 13:32 Modified: 3 Jun 2005 16:25
Reporter: Mark Johnson (Basic Quality Contributor) Email Updates:
Status: Not a Bug Impact on me:
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.6 OS:
Assigned to: CPU Architecture:Any

[3 Jun 2005 13:32] Mark Johnson
When I try to start mysqld 5.0.6, I get the following error:
Could not open required defaults file: /mnt/raid/mysqldata/my.cnf
Fatal error in defaults handling. Program aborted

However, when I enter "mysqld --verbose --help", it prints out:
Default options are read from the following files in the given order:
/etc/my.cnf ~/.my.cnf

Note that this problem was mentioned in bug #8727, which is now closed.  However, this is still happening with version 5.0.6, which I just downloaded.

Additionally, the binary distribution does not contain a default version of this my.cnf file in the default location for it.  This means I am forced to create one before executing the server.

How to repeat:
I am using a nonstandard location for the data directory.  This is specified in /etc/my.cnf.  I also modified my mysql.server script to have my data directory location.  However, when I try to start mysqld, I get an error that it cannot open a required defaults file.  This required file is not listed as a file searched for options when one executes "mysqld --verbose --help".  It should be.

Suggested fix:
1. Fix "mysqld --verbose --help" so that it contains all locations where my.cnf is required.
2. Add a default /usr/local/mysql/data/my.cnf file to the binary distribution.
[3 Jun 2005 15:23] Sergei Golubchik
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the original bug instead.

Thank you for your interest in MySQL.

Additional info:

This is duplicate of a bug http://bugs.mysql.com/bug.php?id=10940
which is fixed in 5.0.7 by the following patch
(you may want to apply it manually - it's one-line change):

[3 Jun 2005 15:28] Matthew Lord
I verified this on linux:
Linux booty 2.4.21 #12 SMP Thu Aug 14 00:49:40 EDT 2003 i686 i686 i386 GNU/Linux

5.0.6 is not reading /usr/local/mysql/data/my.cnf

Here is how to see it aside from doing --verbose --help | head:
edit /usr/local/mysql/data/my.cnf and add this:

Then look at the --help --verbose | grep unsafe output from 4.1 binaries
and 5.0.6 binaries.  You'll see that it's TRUE for 4.1 but still FALSE for 5.0.6.
[3 Jun 2005 16:25] Matthew Lord
Hi Mark,

Thanks again for your bug report!  As Serg mentioned part of your problem has already been
fixed (the startup problem) by the fix for the other bug report.

With regards to the incomplete my.cnf location, this was due to a change in 5.0.3 that even I had
missed.  You can see an explanation of it here:

"On Unix, MySQL programs read startup options from the following files:

Filename	Purpose
/etc/my.cnf	Global options
$MYSQL_HOME/my.cnf	Server-specific options
defaults-extra-file	The file specified with --defaults-extra-file=path, if any
~/.my.cnf	User-specific options
MYSQL_HOME is an environment variable containing the path to the directory in which the server-specific my.cnf file resides. This used to be DATADIR prior to MySQL version 5.0.3."

DATADIR here is referring to the compiled in default of /usr/local/mysql/data.

Best Regards