Bug #19450 mysqld does not check specified datadir for my.cnf file
Submitted: 30 Apr 2006 22:07 Modified: 23 May 2006 16:46
Reporter: Lachlan Mulcahy Email Updates:
Status: Not a Bug Impact on me:
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0 OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[30 Apr 2006 22:07] Lachlan Mulcahy
If you pass the mysqld binary the value of datadir, directly or from a my.cnf file, as a non-standard path such as, /mnt/data, the mysqld binary will still look in it's compiled in default datadir for a my.cnf file - Eg. /usr/local/mysql/data instead of /mnt/data as expected.

How to repeat:
see above

Suggested fix:
Have mysqld override the default compiled in.
[23 May 2006 12:38] Paul Dubois
Expected behavior.  The server reads options based on the my.cnf
files found in the standard directories (one of which is the hardwired
datadir value), and then processes those options.  So you can tell
the server the path of the datadir to use at runtime, but not the
path of the datadir to use when looking for my.cnf files.
[23 May 2006 16:46] Lachlan Mulcahy
As per Paul's reponse -- find more information in the manual here:

[23 May 2006 16:52] Paul Dubois
Note particularly that you can use --defaults-file or --defaults-extra-file
to explicitly specify a my.cnf file from which options should be read.