Bug #5354 Read config files from C:\Windows & C:\WINNT
Submitted: 1 Sep 2004 20:43 Modified: 7 Jul 2005 17:02
Reporter: Jorge del Conde Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:ALL OS:Windows (Win32)
Assigned to: Jim Winstead CPU Architecture:Any

[1 Sep 2004 20:43] Jorge del Conde
Description:
If one installs mysql in a shared windows OS, there's no way of knowing what the search path for my.cnf (or my.ini) will be except for C:\.

Given the above scenario, if one doesn't want to have my.cnf in C:\ , there really isn't much of a choise on where to place the options file.  This happens because of the way the GetWindowsDirectory() function works.  In other words, we have no guarantee that GetWindowsDirectory() == %WINDIR%.

We can solve this problem by having mysql read the contents of an environment variable (i.e. MYSQL_DEFAULTS_FILE) and if my.cnf is not found in any of the default search paths, then we can read the value of MYSQL_DEFAULTS_FILE and get the options file from it.

The only way around this problem right now is to specify the '--defaults-file' argument for mysqld and mysql, but none of our other tools support this argument and this won't solve the fact that '--defaults-file' will have to be specified each time we execute one of our tools.

How to repeat:
install mysql in a shared win os and youll see what i mean
[1 Sep 2004 22:52] Jorge del Conde
I forgot to mention this in my previous request.

Adding %WINDIR% as part of the search path would be a good idea also.

Note that GetWindowsDirectory() isn't always the same as %WINDIR%
[7 Apr 2005 19:57] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/23778
[7 Apr 2005 22:37] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/23779
[28 Apr 2005 19:12] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/24462
[2 May 2005 19:07] Jim Winstead
Fixed in 5.0.6.
[19 May 2005 18:34] Jim Winstead
It looks like this won't be enabled in our builds, since we don't link against the Platform SDK.
[23 May 2005 18:08] Jim Winstead
Reopening: the committed fix isn't enough, and won't be in effect in the builds we are doing.
[24 May 2005 2:49] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/25201
[6 Jul 2005 17:49] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/26733
[6 Jul 2005 18:46] Jim Winstead
Fixed (again) in 5.0.10.
[7 Jul 2005 17:02] Jon Stephens
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Documented bugfix in 5.0.10 change history; closed.