Bug #1529 my_print_defaults doesn't understand single-component pathnames?
Submitted: 10 Oct 2003 20:53 Modified: 14 Oct 2003 9:48
Reporter: Paul DuBois Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:4.x OS:
Assigned to: Sergei Golubchik CPU Architecture:Any

[10 Oct 2003 20:53] Paul DuBois
Description:
my_print_defaults doesn't correctly read a file
in the current directory -- unless you specify it
using a multiple-component pathname.  Here's
my .my.cnf file:

[mysql]
no-auto-rehash

And here are some commands to use it. Note that
the first one results in no output.

% my_print_defaults --config-file=.my.cnf mysql
(no output)
% my_print_defaults --config-file=./.my.cnf mysql
--no-auto-rehash
% my_print_defaults --config-file=../paul/.my.cnf mysql
--no-auto-rehash

How to repeat:
See above.
[12 Oct 2003 19:28] MySQL Verification Team
Also on Windows I get the below results:

e:\servers\mysql-4.0.15\bin>my_print_defaults --config-file=my.ini mysql

e:\servers\mysql-4.0.15\bin>my_print_defaults --config-file=./my.ini mysql
--no-auto-rehash
[14 Oct 2003 9:48] Sergei Golubchik
it's not a bug. my_print_defaults (and mysqld, and all utility programs) treats filename without a path as a name to search in all default directories (where it searches for my.cnf), but substituting "my" with the given string. Thus

my_print_defaults --config-file=.my.cnf

searches for

/etc/.my.cnf.cnf
DATADIR/.my.cnf.cnf
~/..my.cnf.cnf

Note that my_print_defaults in the command-line help prints:

  -c, --config-file=#, --defaults-file=#
                       The config file to use (default 'my')