user in ~/.my.cnf is ignored

Bug #1269093 reported by Aleksandr Kuzminsky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mylvmbackup
Invalid
Undecided
Unassigned

Bug Description

If a user is specified in ~/.my.cnf but not in command line mylvmbackup ignores it, instead uses default root

# mylvmbackup --backupdir='$BACKUPDIR' --vgname=$VG --lvname=$LV --xfs
20140114 18:24:05 Info: Connecting to database...
DBI connect('database=mysql;mysql_read_default_group=client','root',...) failed: Access denied for user 'root'@'localhost' (using password: YES) at /usr/bin/mylvmbackup line 202
20140114 18:24:05 Error: Access denied for user 'root'@'localhost' (using password: YES)
20140114 18:24:05 Info: Running hook 'logerr' as perl module.
Uncaught exception from user code:
        Access denied for user 'root'@'localhost' (using password: YES) at /usr/bin/mylvmbackup line 206.
 at /usr/bin/mylvmbackup line 206

# cat ~/.my.cnf
#
[client]
user=backuper
password=qwerty
socket = /var/lib/mysql/mysql.sock

If the user is specified in the command line the password is successfully read from ~/.my.cnf

Revision history for this message
Lenz Grimmer (lenzgr) wrote :

This might be a bug or feature of the MySQL client library (and hence DBI) - not sure if I can do anything about that.

Revision history for this message
Lenz Grimmer (lenzgr) wrote :

Sorry for the delay in responding. What user name did you define in the [mysql] configuration group in /etc/mylvmbackup.conf?

I wonder if mylvbackup simply defaults to the user defined in there (root by default), if you do not override the user name with the --user option on the command line.

Revision history for this message
Aleksandr Kuzminsky (akuzminsky) wrote :

I don't remember editing /etc/mylvmbackup.conf, so it's quite probable the default root.

Revision history for this message
Lenz Grimmer (lenzgr) wrote :

OK, thanks - I'll resolve this as not a bug then. You need to provide the username in the config file.

Changed in mylvmbackup:
status: New → Invalid
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.