pdufault/mysqlfragfinder

.my.cnf parsing issues

Closed this issue · 1 comments

Hi,

I have noticed a few issues with the .my.cnf part of the script.

Firstly, the wrong variable is set on line 45: mysqlpassword:

mysqlpassword=$(grep password= < "$HOME/.my.cnf" | awk -F\" '{print $2}');

It ought to read:

mysqlPass=$(grep password= < "$HOME/.my.cnf" | awk -F\" '{print $2}');

Secondly, in my .my.cnf the password is passed with "pass=". I understand this can be done two ways but it would seem that it could be an idea to make both possible.

This is my original configuration file, which works fine with normally:

[client]
pass="[deleted]"
user=root

Also, the script failed to pick up my user name because it wan't enclosed with quotation marks. So, I had to change my configuration file to:

[client]
password="[deleted]"
user="root"

It could be an idea to make the script a bit more tolerant.

Niklas

Thanks for the fix for the password grep.