pt-table-checksum --recursion-method=hosts will not use user/password given through --defaults-file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
New
|
Undecided
|
Unassigned |
Bug Description
I would expect auth information from --defaults-file to be inherited by hosts discovered through SHOW SLAVE HOSTS... of course we could report-user and report-password from the slaves, but not sure if that's conisdered good security practice. and --ask-pass won't work for unattended scripts.
Here's my simple test:
[kolita@diogenes demos]$ cat ./assets/.my.cnf
[client]
user=demo
password=demo
[kolita@diogenes demos]$ mysql -h127.0.0.1 -P13307 -udemo -pdemo
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 5.5.23-rel25.3-log Percona Server with XtraDB (GPL), Release rel25.3, Revision 240
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> Bye
[kolita@diogenes demos]$ mysql -h127.0.0.1 -P13306 -udemo -pdemo -t -v -e "SHOW SLAVE HOSTS";
--------------
SHOW SLAVE HOSTS
--------------
+------
| Server_id | Host | Port | Master_id |
+------
| 13307 | 127.0.0.1 | 13307 | 13306 |
| 13308 | 127.0.0.1 | 13308 | 13306 |
+------
If we don't give u=demo,p=demo and rely only on --defaults-file it won't be able to connect to slaves.
[kolita@diogenes demos]$ ./bin/pt-
Cannot connect to P=13307,h=127.0.0.1
Cannot connect to P=13308,h=127.0.0.1
TS ERRORS DIFFS ROWS CHUNKS SKIPPED TIME TABLE
09-05T10:25:29 0 0 9 1 0 0.009 employees.
09-05T10:25:29 0 0 331603 5 0 0.470 employees.dept_emp
09-05T10:25:29 0 0 24 1 0 0.002 employees.
09-05T10:25:30 0 0 300024 1 0 0.449 employees.employees
^C# Caught SIGINT.
09-05T10:25:33 0 0 1721748 4 0 2.992 employees.salaries
And it works if we pass the info there, or if we use --ask-pass it works as expected:
[kolita@diogenes demos]$ ./bin/pt-
TS ERRORS DIFFS ROWS CHUNKS SKIPPED TIME TABLE
09-05T10:25:43 0 0 9 1 0 0.018 employees.
09-05T10:25:44 0 0 331603 5 0 1.285 employees.dept_emp
09-05T10:25:44 0 0 24 1 0 0.050 employees.
09-05T10:25:45 0 0 300024 1 0 1.020 employees.employees
^C# Caught SIGINT.
09-05T10:25:45 0 0 473204 1 0 0.464 employees.salaries
Maybe it's documented behavior and I failed to find it in the docs?
Thanks!
tags: | added: pt-table-checksum |
This is a duplicate of 1034170 which has been fixed in unreleased Percona Toolkit 2.1.4 (and also in bzr trunk).