mysql / mysql-utilities

MySQL Utilities is a set of easy-to-use scripts intended to make working with MySQL servers easier.
GNU General Public License v2.0
267 stars 161 forks source link

MyDefaultsReader doesn't decode password from login-path #18

Closed wangguoqin1001 closed 7 years ago

wangguoqin1001 commented 7 years ago

from mysql.utilities.common.my_print_defaults import MyDefaultsReader r = MyDefaultsReader() r.get_group_data('LOGIN-PATH') {'host': '127.0.0.1', 'password': '*****', 'user': 'root', 'port': 'PORT'}

With .mylogin.cnf generated by mysql_config_editor from MySQL Client 5.7, the password is encoded. my_print_defaults LOGIN-PATH doesn't show the password in plain text but **, while my_print_defaults -s LOGIN-PATH shows the password in plain text. MyDefaultsReader calls my_print_defaults which runs my_print_defaults LOGIN-PATH so that the password param is been filled with asterisks and this causes almost every utilities to fail with ERROR: Access denied for user 'root'@'127.0.0.1' using password: YES.

Maybe calling my_print_defaults with -s option would solve the problem?

P.S. mysql-cli works perfectly with the same .mylogin.cnf.