Problem while connecting to cloud database

笑着哭i 提交于 2019-12-11 10:09:56

问题


I am encountering a problem while connecting to the cloud database.

In SqlCmd I have used like:

sqlcmd -U servername@username -P myPassword -S servername.database.windows.net -d MyFirstCloudTestDB

And it is correct. The error message is :

Msg 40615, Level 14, State 1, Server servername, Line 1
**Cannot open server 'servername' requested by the login. Client with IP address '
124.40.110.238' is not allowed to access the server.**
Msg 18456, Level 14, State 1, Server servername, Line 1
Login failed for user 'username'.

I have no clue what to do!


回答1:


Right... try this:

Go to the sql.azure.com, log in, and go to your project's page. Where you see a list of databases, you should also see a tab which says "Firewall settings". Put a rule in to allow your IP addres range.

But also check to see how your range is viewed from outside the network.




回答2:


Don't you want: username@servername ?




回答3:


Have you created the database in question? If not, try connecting to the master database instead.




回答4:


You have to cancel the first screen and connect the SQL Azure using the New Query button window. In the options -> connect to Database -> MyFirstCloudTestDB and try. It should work.

If you have problem with the IP address. Change the firewall settings in the SQL AZure. The range 0.0.0.0 to 255.255.255.255. It is not recommendable but for time being it is alright.



来源:https://stackoverflow.com/questions/1605303/problem-while-connecting-to-cloud-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!