简体   繁体   中英

Cannot access Azure SQL database

I am having trouble accessing my Azure SQL database. I Have whitelisted my ip address(using 'what is my ip' in google to find it) The connection string in the azure portal is -

Driver={SQL Server Native Client 10.0};Server=tcp:nrmuolxpqg.database.windows.net,1433;Database=databasename;Uid=username@nrmuolxpqg;Pwd={your_password_here};Encrypt=yes;Connection Timeout=30;

What do I put into the Migration Tool, or into visual studio as the connection properties? In particular what to do with the 'tcp' at the starte of the server string?

The fields I need to fill in are:

-Server name (do I need to put tcp or the port number in here? )

-Login

-password - (this is my windows account password right? )

-Database

The only thing you need to change is the username and password. This is something you specified when you created the server. It's not the same as your Windows username and password.

If you forgot the password, you can reset following these instructions, Password reset for Azure database .

EDIT 06/20/2018 - Finding the username

If you forgot your username, you can find it by clicking the Show database connection strings link in the Essentials window.

在此处输入图片说明

The ADO.NET connection string will not show the username but any of the other examples will.

在此处输入图片说明

Here are a few additional things you can try to resolve connection issues.

Try pinging the server. The server doesn't respond to the request but the name should be resolved to an IP address. ping服务器

Verify that your client IP address has been added as a firewall rule. 客户IP

Make sure you are using the correct connection string (in your question you are using the ODBC connection string, you might want to try the ADO.NET one). Also double-check that you use the correct username and password. 连接字符串

To connect from Visual Studio, add a connection from the Server Explorer window using the server name and login info as shown below. Obviously you have to change the server name and login info to match you specifics. I'm connecting to a database called StackDemo in the below screenshot. Visual Studio连接

If you still can't connect, there might be an issue where your company's or personal firewall is blocking the connection.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM