Bug #29327 mysqld_multi doesn't support !include or !includedir directives
Submitted: 25 Jun 2007 0:59 Modified: 27 Sep 2007 21:02
Reporter: Jason Sydes Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version:5.0.38, 5.1 OS:Any
Assigned to: CPU Architecture:Any
Tags: !include, !includedir, Contribution, include, includedir, mysqld_multi
Triage: Needs Triage: D5 (Feature request)

[25 Jun 2007 0:59] Jason Sydes
Description:
mysqld_multi appears to not recognize !include and !includedir directives inside my.cnf.  It just silently ignores them.

I'm pretty sure this is correct.

I also tried using the mysqld_multi from 5.1.19 with my 5.0.38 installed version, and it failed there too. 

It would be nice to be able to define each mysql instance in a different configfile (eg mysqld1.cnf, mysqld2.cnf).

I haven't tested this out with the MySQL Instance Manager.

How to repeat:
Create a normal my.cnf, but without a [mysqld] group, or any [mysqldN] groups.
Create a file mysqld1.cnf that includes a [mysqld1] group.
Add the following line to your my.cnf:
!include /path/to/cnf/mysqld1.cnf

Try to start mysqld1 with:
mysqld_multi start
or
mysqld_multi start 1
and I believe it won't work.

To confirm that mysqld_multi does work, just copy everything in mysqd1.cnf into my.cnf, and repeat the commands above.

Repeat the experiment by changing the !include line above to something like:
!includedir /path/to/cnf/
[25 Jun 2007 1:01] Jason Sydes
comma separated tags
[25 Jun 2007 19:06] Sveta Smirnova
Thank you for the report.

Verified as described.
[27 Sep 2007 21:02] Konstantin Osipov
Thank you for a feature request.
[27 Jun 2008 12:13] Volodymyr Lisivka
We use this small patch as workaround:

--- mysqld_multi	2008-06-27 15:08:01.000000000 +0300
+++ mysqld_multi.new	2008-06-27 14:47:46.000000000 +0300
@@ -447,7 +447,9 @@
                '/etc/my.cnf',
                ($ENV{MYSQL_HOME} ? "$ENV{MYSQL_HOME}/my.cnf" : undef),
                $opt{'extra-file'},
-               ($ENV{HOME} ? "$ENV{HOME}/.my.cnf" : undef));
+               ($ENV{HOME} ? "$ENV{HOME}/.my.cnf" : undef),
+               </etc/mysql.d/*.cnf>
+               );
 }
[13 Mar 2011 9:12] steve weber
Why has this not been fixed yet?  I would think this feature is important.
[8 Aug 2011 14:33] Mathieu Parent
Patch

Attachment: bug29327.diff (text/x-diff), 533 bytes.

[8 Aug 2011 14:35] Mathieu Parent
I have attached a patch for easy inclusion on trunk, 5.5 and 5.1. It adds </etc/mysql/conf.d/*.cnf> (Debian and like) and </etc/mysql.d/*.cnf> (Redhat and more).

Could it be included?
[5 Dec 2011 10:56] Thomas Wallrafen
Hello,

how is the status of this issue?
If you could add this patch it would be really helpful for us!

Thomas
[5 Dec 2011 18:28] Dimitriy A
We use a workaround for supporting custom locations of my.cnf for each instance. Each instance set up follows a certain path standard and each one contains its own my.cnf file. We modified /etc/init.d/mysql script to pick up the correct my.cnf file depending on which instance is being started or stopped.
[25 Jan 2012 16:12] Mathieu Parent
This one and bug #49356 are duplicates
[25 Jan 2012 16:19] Valeriy Kravchuk
Bug #49356 was marked as a duplicate of this one.
[18 Feb 2015 18:19] Benjamin DUPUIS
After 6 years, not merged ?!!
[7 Jul 2016 13:22] Thomas Molle
Same thing with 5.6, is it normal?
[8 Sep 2016 21:45] Lucian Costin
i have the same situation in mysql 5.6 @ 9 years later :-(
[21 Aug 2017 15:55] Iaroslav Pleten
This isn't not good.
[28 Dec 2018 3:57] Ankhbayar Gansukh
The bug still exists at mysql5.7