Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure SQL - Login failed for user

I am using a free azure subscription, have set up an SQL server (v12) and created a database onto it.

However i cant seem to log in using the server admin credentials that i set when prompted during the SQL server credentials.

Management Studio returns:

Cannot connect to <server name>...Login failed for user 'mickey'

SQLCMD -S <servername>.database.windows.net -U mickey@servername -P pass -q "select 1"

Returns

Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Login failed for user '

Is there something i am missing? Been at this for hours

like image 865
Glitch Avatar asked Jul 13 '26 13:07

Glitch


1 Answers

It could be the password contains a few special characters that sqlcmd does not handle (such as dollar, single or double quote, parentheses). I tried using the Azure interface and surrounding the password with single-quotes (we had a dollar-sign in the password), but that did not work. So, we simply removed the special character and now it is OK. see: Powershell Invoke-Sqlcmd Login Failed and https://mohitgoyal.co/2017/08/09/vsts-azure-sql-database-deployment-task-keeps-failing-with-error-login-failed-for-user/

like image 163
Davemundo Avatar answered Jul 16 '26 02:07

Davemundo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!