Whenever mysqld is launched, it has four default locations it attempts to locate and read my.cnf
If you run the following:
mysqld --help --verbose | head -20 > junk.txt
cat junk.txt
You will see this:
mysqld Ver 5.6.10 for Linux on x86_64 (MySQL Community Server (GPL))
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Starts the MySQL database server.
Usage: mysqld [OPTIONS]
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
The following groups are read: mysqld server mysqld-5.6
The following options may be given as the first argument:
--print-defaults Print the program argument list and exit.
--no-defaults Don't read default options from any option file,
except for login file.
--defaults-file=# Only read default options from the given file #.
Note the line that says:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
These are the four files read (if they exist).
The above displays come from a Linux Box. So, please run
mysqld --help --verbose | head -20 > junk.txt
cat junk.txt
and see what locations are echoed.
UPDATE 2013-03-17 22:35 EDT
The reason you cannot see the --defaults-file
option is not visible is simple: Since one or more of the default my.cnf
files are present, mysqld_safe
does not show it on the command line.
Please note the following:
mysqld
uses the four defaults
- You cannot set
--defaults-file
for mysqld. That's the job of mysqld_safe
mysqld_safe
needs it explicitly specified in order for it to be visible in the OS
Running SHOW GLOBAL VARIABLES;
will not show any defaults file
mysql> show global variables like '%def%';
+------------------------+--------+
| Variable_name | Value |
+------------------------+--------+
| default_storage_engine | InnoDB |
| default_week_format | 0 |
| table_definition_cache | 400 |
+------------------------+--------+
3 rows in set (0.00 sec)
mysql>