Bug #1813 using multiple configfiles with --defaults-extra-file/--defaults-file
Submitted: 12 Nov 2003 3:08 Modified: 28 Dec 2005 8:31
Reporter: Anders Henke Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:4.0.15a OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[12 Nov 2003 3:08] Anders Henke
Description:
mysqld --help gives a (consistent) description on --defaults-extra-file.
When trying to use --defaults-extra-file together with --defaults-file, mysqld complains about the "unknown variable defaults-extra-file"; however, I'd like to load two config files right after each other (one having site defaults, the second one only per-host defaults).

How to repeat:
host:~# /usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf \
--defaults-extra-file=/db/etc/my.cnf 

gives

/usr/sbin/mysqld: ERROR: unknown variable 'defaults-extra-file=/db/etc/my.cnf'

Running with --defaults-extra-file but without --defaults-file works; after browsing the docs, --defaults-file is somewhere documented as 'Only use the given configuration file'. 
However, trying to use --defaults-extra-file two times also doesn't work as expected.

Suggested fix:
Make it work :-)

Currently I'm using some kludge like

/usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf \
`my_print_defaults --config-file=/db/etc/my.cnf mysqld mysql-server`
[27 Nov 2005 11:56] Valeriy Kravchuk
Thank you for a feature request. Please, read about the current implementation of option files processing (http://dev.mysql.com/doc/refman/5.0/en/option-files.html). About !include, sequence of files used etc. Do you think that any other features are still needed?
[28 Dec 2005 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[1 Oct 2007 11:42] volk augstein
same problem here in 4.1.22 ---- no success using a cnf file. stil the same errors as explained before.
[1 Oct 2007 11:45] volk augstein
this is really weird. just a fresh install of 4.1.22 from source

command :
/home/mysql/v4/current/bin/mysqld_safe --datadir=/home/mysql/DATA1.v4 --pid-file=/home/mysql/DATA1.v4/myhost.com.pid --port=3309 --socket=/tmp/mysql4-1.sock --err-log=/home/LOGS/mysql/mysql4-1.err.log --defaults-extra-file=/home/mysql/v4/mysql4-1.cnf --log=/home/LOGS/mysql/mysql4-1.log

errorlog:

[root]# tail /home/LOGS/mysql/mysql4-1.err.log
071001 13:35:08  mysqld started
071001 13:35:08 [ERROR] /home/mysql/v4/current/libexec/mysqld: unknown variable 'defaults-file=/home/mysql/v4/mysql4-1.cnf'

071001 13:35:08  mysqld ended

071001 13:43:13  mysqld started
071001 13:43:13 [ERROR] /home/mysql/v4/4.1.22/libexec/mysqld: unknown variable 'defaults-extra-file=/home/mysql/v4/mysql4-1.cnf'

071001 13:43:13  mysqld ended

---

still guessing around and not working.
[7 Jul 2008 12:08] Frank Bösing
5.1.25 / Windows 2000 does still not work