Bug #77946 MySQL 5.6.25 and newest : mysqld_multi depency to my_print_defaults

Submitted: 5 Aug 2015 12:21 Modified: 5 Aug 2015 12:27
Reporter: jerome witt Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S1 (Critical)
Version:5.6.26 OS:Any
Assigned to: CPU Architecture:Any
Tags: my_print_defaults, mysqld_multi

[5 Aug 2015 12:21] jerome witt
Description:
Impossible to stop the MySQL Server "mysqld1"...

mysql@vdbprd101:/home/mysql/ [mysqld1] mysqld_multi stop 1
WARNING: Log file disabled. Maybe directory or file isn't writable?
mysqld_multi log file version 2.16; run: Wed Aug  5 13:57:10 2015

Stopping MySQL servers
mysql@vdbprd101:/home/mysql/ [mysqld1] Warning: Using a password on the command line interface can be insecure.
/disk00/app/mysql/product/mysql-5.6.26/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'multi_admin'@'localhost' (using password: YES)'

All other commands works as expected (start and report).
The user has been created correctly and the password is correct!
Adding the password as command-line optionn, gave the expected result

mysql@vdbprd101:/home/mysql/ [mysqld1] mysqld_multi stop 1 -password=dbi05manager
WARNING: Log file disabled. Maybe directory or file isn't writable?
mysqld_multi log file version 2.16; run: Wed Aug  5 14:00:30 2015

Stopping MySQL servers
Warning: Using a password on the command line interface can be insecure.

Verification using the MySQL utility "my_print_defaults" gave the correct result (since MySQL 5.6.25 the password is no more visible in cleartext by default, add the option "-s")

mysql@vdbprd101:/home/mysql/ [mysqld1] my_print_defaults mysqld_multi
--user=multi_admin
--password=*****
mysql@vdbprd101:/home/mysql/ [mysqld1] my_print_defaults mysqld_multi -s
--user=multi_admin
--password=dbi05manager

How to repeat:

mysql> show grants for 'multi_admin'@'localhost';
+-----------------------------------------------------------------------------------------------------------------------+
| Grants for multi_admin@localhost                                                                                      |
+-----------------------------------------------------------------------------------------------------------------------+
| GRANT SHUTDOWN ON *.* TO 'multi_admin'@'localhost' IDENTIFIED BY PASSWORD '*1F95F9496F78BA384737C7921472C74BB6371CD6' |
+-----------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> show grants for 'multi_admin'@'localhost';
+-----------------------------------------------------------------------------------------------------------------------+
| Grants for multi_admin@localhost                                                                                      |
+-----------------------------------------------------------------------------------------------------------------------+
| GRANT SHUTDOWN ON *.* TO 'multi_admin'@'localhost' IDENTIFIED BY PASSWORD '*1F95F9496F78BA384737C7921472C74BB6371CD6' |
+-----------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

Suggested fix:

Fortunately, "mysqld_multi" is a perl program :) and after a debug session .We were able to identify the problem and apply a workaround:

Edit the ${MYSQL_HOME}/bin/mysqld_multi scipt
FROM
216   my $com= join ' ', 'my_print_defaults', @defaults_options, $group;
217   my @defaults = `$com`;
TO
216   my $com= join ' ', 'my_print_defaults --show', @defaults_options, $group;
217   my @defaults = `$com`;

The purpose of the above lines is simple to understand; Read the MySQL configuration using the "my_print_defaults" utility and store the output in an array.

Details about the "--show" aka. "-" option have been explained a few lines ahead. Once, the password agin available in cleartext for further processing, everything worked fine (so far).
[5 Aug 2015 12:27] MySQL Verification Team
Hello jerome witt,

Thank you for the report.
This is most likely duplicate of Bug #77227

Thanks,
Umesh

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.051 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.