Bug #18579 mysql_install_db script only creates databases for first instance in my.cnf
Submitted: 28 Mar 2006 17:10 Modified: 8 Dec 2016 9:50
Reporter: Jonathan Miller Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:5.1.9 OS:Linux (Linux 32 Bit OS)
Assigned to: CPU Architecture:Any
Triage: Triaged: D4 (Minor)

[28 Mar 2006 17:10] Jonathan Miller
Description:
Using the my.cnf below, if you run mysql_install_db   only files for [mysqld] will be created.

[manager]
default-mysqld-path = /home/ndbdev/jmiller/builds/libexec/mysqld
socket=/tmp/manager.sock
pid-file=/tmp/manager.pid
monitoring-interval = 50
port = 1999

[mysqld]
server-id=2
log-bin    = /space/var/master1
log-error  = /space/var/ndb09.err
socket     = /tmp/mysql.sock
port       = 3306
pid-file   = /space/var/hostname.pid1
datadir    = /space/var/
language   = /home/ndbdev/jmiller/builds/share/mysql/english/

[mysqld2]
server-id=3
log-bin    = /space/var1/master1
log-error  = /space/var1/ndb09.err
socket     = /tmp/mysql2.sock
port       = 3307
pid-file   = /space/var1/hostname.pid1
datadir    = /space/var1/
language   = /home/ndbdev/jmiller/builds/share/mysql/english/

How to repeat:
See above

Suggested fix:
Should create database files for all [mysqld], [mysqld#]
[3 Aug 2006 9:41] 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/9996

ChangeSet@1.2242, 2006-08-03 02:40:47-07:00, igreenhoe@anubis.greendragongames.com +1 -0
  Fix for bug #18579 (mysql_install_db only creates database for first
  instance in my.cnf)
  
  Problem:  Short of editing the my.cnf file, there was no way of
  creating a database for anything other than what was listed in the
  "[mysqld]" group.
  
  Solution:  Added command argument to mysql_install_db to direct it to
  use "[mysqld2]", etc., groups ( --defaults-group-suffix=# ).  This is
  the same argument used in the server to select such behavior.
  
  Please note that this solution does not automatically handle all
  groups in the config file (since that behavior is radically different
  from current behavior and could lead to data lossage if someone used
  this tool when databases described in other groups existed.)
  However, it is now possible to create a wrapper for this script to
  handle all such groups.
[3 Aug 2006 19:38] Ian Greenhoe
Pulling this back, since I want to do a combined patch with #17979.
[4 Aug 2006 11:18] Ian Greenhoe
Patch is same as for Bug #17979.  (This bug is not *quite* a duplicate of 17979).
[4 Aug 2006 22:01] Ian Greenhoe
Per disccussion with Tim Smith, can't *quite* fix this this way.
[7 Aug 2006 22:57] 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/10134

ChangeSet@1.2250, 2006-08-07 15:57:07-07:00, igreenhoe@anubis.greendragongames.com +1 -0
  Fix for bug #18579 (mysql_install_db script only creates databases
  for first instance in my.cnf)
  
  Problem:  No way to specify for mysql_install_db to use the
  additional instances of configuration information located in the
  my.cnf file.
  
  Solution:  Added support for the --defaults-group-suffix switch,
  which is the switch used in mysqld (and my_print_defaults) to
  select such behavior.  Also contains the mysqld-VERSION group
  (so this patch supersedes the patch for 17979 on version 5.0 and
  up).
  
  Note: mysql_install_db will still only initialize one database at a
  time.  If a site needs to initialize more than one database
  programatically, it is now possible to create a script to do so.
[8 Dec 2016 9:50] Yngve Svendsen
Posted by developer:
 
This was indeed a real bug, but in a now EOL version of MySQL. Furthermore, with the time that has passed, the impact is much diminished: MySQL 5.7 and newer do not use mysql_install_db on any platform, and the main delivery vehicle for MySQL on Windows is the new MySQL Installer for Windows, which does not employ mysql_install_db for any version of MySQL. Weighing that against the risk and effort of fixing this properly, I am closing this as Not feasible to fix.