using --defaults-file can't use host from there

Bug #1314696 reported by Elan Ruusamäe
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to

Bug Description

i wish to keep connect credentials in separate file, so it can be shared across applications

there's --defaults-file option, which tells DBI to tell libmysqlclient library to use that file as defaults.

with my credentials file being:
user = username
pass = password
port = 3314
host = dbhost

$ pt-kill --config /etc/percona-toolkit/pt-kill.conf --print --verbose --defaults-file /etc/credentials.ini

DBI is called with arguments:

DBI connect(';mysql_read_default_file=/etc/credentials.ini;host=localhost;mysql_read_default_group=client','',...)

all params except host work, but host parameter is always enforced to be localhost!

ideally i would like to able to specify different `mysql_read_default_group=client` too (which is another parameter being enforced)

Revision history for this message
Elan Ruusamäe (glen666) wrote :

solution to remove enforced "localhost"

tags: added: pt-kill
tags: added: option-parsing
removed: pt-kill
Revision history for this message
Nilnandan Joshi (nilnandan-joshi) wrote :


nilnandan@nilnandan-Dell-XPS:~$ pt-kill --version
pt-kill 2.2.9
nilnandan@nilnandan-Dell-XPS:~$ cat /home/nilnandan/credentials.cnf
user = root
pass = root
port = 3306
host = dbhost
nilnandan@nilnandan-Dell-XPS:~$ pt-kill --config /etc/percona-toolkit/pt-kill.conf --print --verbose --defaults-file /home/nilnandan/credentials.cnf
DBI connect(';mysql_read_default_file=/home/nilnandan/credentials.cnf;host=localhost;mysql_read_default_group=client','',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /usr/bin/pt-kill line 2059.

Changed in percona-toolkit:
status: New → Confirmed
tags: added: i53309
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to:

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.