Reputation: 667
I am using azure and mysql. I CAN connect to the azure mysql instance with the GUI mysql workbench however trying to connect with the command line always gives an access denied.
Here is my connection string (obfuscated)
mysql -h azureserver -u myuser -p thepass -D thedatabase
Here is the output from the command
$ mysql -h azureserver -u myuser -p thepass -D thedatabase
Enter password:
ERROR 1045 (28000): Access denied for user 'myuser'@'azureserver' (using password: NO)
Why can I connect with the GUI client and the command line client fails? I used the -p to specify a password but clearly the results implies that I am not using a password (see above)
Am I missing some detail when trying to connect through the command line to an Azure mysql instance?
The Azure tutorial implies that this is all I need PHP mysql azure tutorial
So to summarize:
Upvotes: 2
Views: 7836
Reputation: 146450
Key points:
-p thepass
using password: NO
As per the docs:
--password[=password], -p[password]
The password to use when connecting to the server. If you use the short option form (-p), you cannot have a space between the option and the password. If you omit the password value following the --password or -p option on the command line, mysql prompts for one.
So you're asked for a password, but you apparently didn't type anything at the Enter password:
prompt. Thus the error.
Upvotes: 3