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.
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.
A quick example:
mysql_config_editor print --allSettings 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_config_editor set --login-path app-db1 --password --host=127.0.0.1 --user=appuser
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.
Comments