Bug #80281 mysqlbinlogpurge is unable to use a stored password
Submitted: 5 Feb 2016 11:53 Modified: 21 Oct 2016 7:00
Reporter: Taneli Leppä Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Utilities Severity:S3 (Non-critical)
Version:1.6.2 OS:CentOS (7)
Assigned to: CPU Architecture:Any

[5 Feb 2016 11:53] Taneli Leppä
Description:
Using mysqlbinlogpurge together with mysql_config_editor results in an access denied error:

# mysql_config_editor set --login-path=db01 --host=localhost --user=root --port=3306 --password
# mysqlbinlogpurge --master db01 --slaves db02
ERROR: Access denied for user 'root'@'localhost' (using password: YES)

This is because mysqlbinlogpurge is calling /usr/bin/my_print_defaults db01 to get the connection details which outputs:
# /usr/bin/my_print_defaults db01
--user=root
--password=*****
--host=localhost
--port=3306

My_print_defaults needs to be passed --show argument to reveal the password:
# /usr/bin/my_print_defaults --show db01
--user=root
--password=ACTUAL-PASSWORD
--host=localhost
--port=3306

How to repeat:
# mysql_config_editor set --login-path=db01 --host=localhost --user=root --port=3306 --password
(enter password)
# mysql_config_editor set --login-path=db02 --host=localhost --user=root --port=3306 --password
(enter password)
# mysqlbinlogpurge --master db01 --slaves db02

Suggested fix:
Add --show flag to mysql/utilities/common/my_print_defaults.py.
[21 Oct 2016 7:00] Chiranjeevi Battula
Hello Taneli Leppä,

Thank you for the bug report.
I tried with latest version of MySQL Utilities 1.6.4 version as well and it worked without any issues.
Probably this is fixed in latest version, please feel free to reopen this bug report if you encounter this issue again.

Thanks,
Chiranjeevi.