Bug #76275 mysqlrpladmin fails to match the repl user host and password
Submitted: 12 Mar 2015 5:41 Modified: 7 May 2018 14:38
Reporter: monty solomon Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Utilities Severity:S2 (Serious)
Version: OS:Linux
Assigned to: CPU Architecture:Any

[12 Mar 2015 5:41] monty solomon
Description:
When trying to complete a switchover, mysqlrpladmin fails to match the repl user password when the host for the existing replication user is '%'

mysqlrpladmin --verbose --master=testbeaverlake --new-master=testslab switchover --demote-master --slaves=-testslab,-testslab2,-testslab3,-testslab4,-testslab6 --rpl-user=Repl:somepassword

# Checking slaves configuration to master.
# When the master_info_repository variable is set to FILE, the --rpl-user option may be used only if the user specified matches what is shown in the SLAVE STATUS output unless the --force option is used.
ERROR: The specified replication user is using a different password that the one specified.

How to repeat:
Set up a replication cluster using the replication user 'Repl'@'%'

GRANT REPLICATION SLAVE ON *.* TO Repl IDENTIFIED BY 'somepassword';

CHANGE MASTER TO MASTER_HOST = 'testbeaverlake', MASTER_USER = 'Repl', MASTER_PASSWORD = 'somepassword', MASTER_LOG_FILE='bin.000004', MASTER_LOG_POS=0, MASTER_CONNECT_RETRY=15, MASTER_HEARTBEAT_PERIOD=1 ; 

Add a rpladmin user to the cluster

GRANT SUPER, GRANT OPTION, SELECT, INSERT, RELOAD, DROP, CREATE, REPLICATION SLAVE, REPLICATION CLIENT ON *.* to rpladmin IDENTIFIED BY  'someotherpassword';

mysql_config_editor set --login-path=testbeaverlake --host=testbeaverlake --user=rpladmin --password --port=3306
mysql_config_editor set --login-path=testslab --host=testslab --user=rpladmin --password --port=3306
mysql_config_editor set --login-path=testslab1 --host=testslab1 --user=rpladmin --password --port=3306
mysql_config_editor set --login-path=testslab2 --host=testslab2 --user=rpladmin --password --port=3306
mysql_config_editor set --login-path=testslab3 --host=testslab3 --user=rpladmin --password --port=3306
mysql_config_editor set --login-path=testslab4 --host=testslab4 --user=rpladmin --password --port=3306
mysql_config_editor set --login-path=testslab5 --host=testslab5 --user=rpladmin --password --port=3306
mysql_config_editor set --login-path=testslab6 --host=testslab6 --user=rpladmin --password --port=3306

Execute a command to switch the master to one of the slaves.

mysqlrpladmin --verbose --master=testbeaverlake --new-master=testslab switchover --demote-master --slaves=testslab,testslab2,testslab3,testslab4,testslab6 --rpl-user=Repl:somepassword

ERROR: The specified replication user is using a different password that the one specified.
Use the --force option to force the use of the user specified with  --rpl-user and new password.
# Errors found. Switchover aborted.

Suggested fix:
In addition to trying the _SELECT_RPL_USER_PASS_QUERY with the new-master hostname, try the query using '%' as the host.
[10 Apr 2015 22:04] monty solomon
When will someone review this bug?
[5 Sep 2015 20:54] monty solomon
What is the status of this bug?
[7 May 2018 14:38] Bogdan Kecman
Hi,
Verified as stated
Bogdan