mysql with mylogin.cnf still asking for password

It's been a while since I've used MySQL. It comes with a great utility: mysql_config_editor, which allows you to save settings for frequently accessed databases. Saving a lot of time typing and trying to remember addresses, user names, etc. 

A quick example:  
mysql_config_editor print --all
mysql_config_editor set --login-path app-db1 --password --host=127.0.0.1 --user=appuser
Settings are saved to mylogin.cnf so that now when you type the following, you'll be logged in and connected the appropriate database catalog as the correct user. 

mysql --login-path=app-db1 -p appdb

Except, when doing this recently, I wasn't. I was still prompted for the password! Can you spot the problem? I'm so accustomed to logging into password protected mysql servers that I typed -p by habit, so the client tool was dutifully prompting me for it. 

Removing the -p flag quickly returned life to normal. 

--- 

For kicks, here's my MySQL prompt: .my.cnf 

Comments

Recent posts