MySQL credentials not taken from file

Bug #1008612 reported by Attila Szucs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ec2-consistent-snapshot
New
Undecided
Unassigned

Bug Description

Whenever I try to pass MySQL credentials to ec2-consistent-snapshot, I get the following error:

================================================================
DBI connect(';host=localhost','root',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at /usr/bin/ec2-consistent-snapshot line 266
ec2-consistent-snapshot: ERROR: Unable to connect to MySQL on localhost as root at /usr/bin/ec2-consistent-snapshot line 266.
================================================================

According to this, ec2-consistent-snapshot doesn't even try to use password. I have the .my.cnf file in my home folder, and it looks like this:
================================================================
[client]
user= root
pass= v3rysecret
================================================================

MySQL console command does log in without asking for password, so the file is set correctly.
I get the same result if I try to use "ec2-consistent-snapshot --mysql --mysql-defaults-file ~/.my.cnf ", but it works fine if I use the --mysql-username and --mysql-password parameters.

The command line what I use is as follows:
================================================================
ec2-consistent-snapshot --region eu-west-1 --mysql --description "`hostname -s`_db-backup [`date +\"%Y.%m.%d. %T\"`]" `cat /etc/ec2-volumeid_db`
================================================================

It's an Ubuntu 12.04 x64

description: updated
Revision history for this message
Bradd Szonye (bszonye) wrote :

While the mysql client recognizes both "pass=" and "password=" in the [client] section, ec2-consistent-snapshot only recognizes "password=", causing the behavior above. Note that some clients only recognize "pass=" instead. The script should probably accept either.

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.