Bug #74636 mysqld_multi misleading when my_print_defaults is not found
Submitted: 30 Oct 2014 13:47 Modified: 1 Mar 2016 15:45
Reporter: Andrii Nikitin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:all OS:Any
Assigned to: CPU Architecture:Any

[30 Oct 2014 13:47] Andrii Nikitin
Description:
mysqld_multi shows misleading error messages when it fails to execute my_print_defaults

How to repeat:
Following steps demonstrate problem in environment without MySQL installed, but similar symptoms with various different misleading messages may be observed in other environments.

1. Find system where no MySQL was ever installed
2. Unpack (not install) mysql package e.g. to ~/Downloads/5.6.21/
3. create configuration file with content:

$tail /etc/my.cnf.multi
[mysqld_multi]
mysqld=/home/a/Downloads/5.6.21/bin/mysqld

[mysqld1]
mysqld=/home/a/Downloads/5.6.21/bin/mysqld
datadir=/aaa

4. Try to start mysqld_multi using commands below:
cd ~/Downloads/5.6.21/bin/
./mysqld_multi --defaults-file=/etc/my.cnf.multi --log=/tmp/a.log

5. Observe error:
FATAL ERROR: Tried to start mysqld under group [mysqld1], but no mysqld binary was found.
Please add "mysqld=..." in group [mysqld_multi], or add it to group [mysqld1] separately.

That concludes the steps demonstrating the problem, following two steps prove that problem is related to my_print_defaults:

6. Modify following line in mysqld_multi from:
  my $com= join ' ', 'my_print_defaults', @defaults_options, $group;
to
  my $com= join ' ', './my_print_defaults', @defaults_options, $group;

7. Now observe expected appropriate error for the same multi call:
./mysqld_multi --defaults-file=/etc/my.cnf.multi --log=/tmp/a.log

Suggested fix:
Properly handle possible errors in following line of mysqld_multi :

  my @defaults = `$com`;
[1 Mar 2016 5:02] Shishir Jaiswal
Posted by developer:
 
Approved on Review Board (RB)
[1 Mar 2016 5:03] Shishir Jaiswal
Posted by developer:
 
This issue existed in 5.5 also so changed the Target version.
[1 Mar 2016 15:45] Paul DuBois
Noted in 5.5.50, 5.6.31, 5.7.13, 5.8.0 changelogs.

mysqld_multi displayed misleading error messages when it was unable
to execute my_print_defaults.