Bug #27390 mysqld_multi --config-file= not working as documented
Submitted: 23 Mar 2007 9:10 Modified: 10 Jul 2007 21:09
Reporter: Johan Idrén Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.0,5.1 OS:Any (*nix)
Assigned to: Timothy Smith CPU Architecture:Any
Tags: bfsm_2007_04_05

[23 Mar 2007 9:10] Johan Idrén
Description:
mysqld_multi --help gives you the following output
"--config-file=...  Alternative config file"
This means, don't use the default. However, /etc/my.cnf is used as well (and is read twice, as per bug #20748).

How to repeat:
Start MySQL server with mysqld_multi with not default configuration file, ie. "/usr/bin/mysqld_multi --config-file=/etc/my2.cnf --log=/tmp/mysqld_multi.log start"

Example,
/etc/my2.cnf:
replicate-do-table	= test.test
replicate-wild-ignore-table	= %.%

/etc/my.cnf:
replicate-do-table	= mysql.users
replicate-do-table	= mysql.db
replicate-wild-ignore-table	= %.%

Information from SHOW SLAVE STATUS from the MySQL server started with "/usr/bin/mysqld_multi --config-file=/etc/my2.cnf --log=/tmp/mysqld_multi.log start":
Replicate_Do_DB: 
Replicate_Ignore_DB: 
Replicate_Do_Table: mysql.users,mysql.users,test.test,mysql.db,mysql.db
Replicate_Ignore_Table: 
Replicate_Wild_Do_Table: 
Replicate_Wild_Ignore_Table: %.%,%.%,%.%

Suggested fix:
Either make --config-file do as documented and only read the specified file, or add --defaults-file to comply with other cli behaviour.

patch mysqld_multi:
@@ -308,6 +308,7 @@
$com.= " $groups[$i]";
@options = `$com`;
chop @options;
+ unshift(@options,"--no-defaults");

$mysqld_found= 1; # The default
$mysqld_found= 0 if (!length($mysqld));
[25 Apr 2007 8: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/commits/25374

ChangeSet@1.2454, 2007-04-25 10:37:47+02:00, tsmith@quadxeon.mysql.com +3 -0
  Bug #27390: mysqld_multi --config-file= not working as documented
  
  Recognize the --no-defaults, --defaults-file and --defaults-extra-file
  options.  Treat old --config-file argument as if --defaults-extra-file
  had been specified instead.
  
  Plus a few other defaults-related cleanups.
[26 Apr 2007 16:57] Tatiana Azundris Nuernberg
elegant, pain-inducing, perl
[28 Apr 2007 8:23] Timothy Smith
Queued to 5.0- and 5.1-maint team trees.
[1 May 2007 20:58] Bugs System
Pushed into 5.1.18-beta
[1 May 2007 20:59] Bugs System
Pushed into 5.0.42
[10 Jul 2007 21:09] Paul Dubois
Noted in 5.0.42, 5.1.18 changelogs.

mysqld_multi now understands the --no-defaults, --defaults-file, and
--defaults-extra-file options. The --config-file option is
deprecated; if given, it is treated like --defaults-extra-file.

Also updated the description at
http://dev.mysql.com/doc/refman/5.0/en/mysqld-multi.html
to describe how these options work.