[英]Why my visual studio 2015 SQL Server doesn't connect with Azure SQL Database?
I have a SQL Server running on Microsoft Azure. 我有一个在Microsoft Azure上运行的SQL Server。 I want to connect it to My Project in Visual Studio 2015 Community.
我想将其连接到Visual Studio 2015社区中的“我的项目”。 I have added my IP address in firewall on server.
我已经在服务器的防火墙中添加了我的IP地址。 I have also made my port 1433 open for sql.
我还为SQL打开了端口1433。 But when I try to connect to database this error shows up.
但是,当我尝试连接数据库时,会出现此错误。 Error Message in SQL Server
SQL Server中的错误消息
It appears that this is a two step process and you either missed the VM configuration or the Azure configuration. 看来这是一个两步过程,您错过了VM配置或Azure配置。 Based on what you said I believe it is the Azure configuration that may have been missed.
根据您所说的,我相信可能遗漏了Azure配置。 This blog post appears to highlight the necessary things that need to be done to connect.
这篇博客文章似乎强调了连接所需的必要操作。
https://blogs.msdn.microsoft.com/ggaurav/2014/01/08/connect-to-sql-database-on-azure-iaas-from-ssms/ https://blogs.msdn.microsoft.com/ggaurav/2014/01/08/connect-to-sql-database-on-azure-iaas-from-ssms/
Below is an excerpt: 以下是摘录:
The two settings which you have to make sure you are checking are :
您必须确保要检查的两个设置是:
Endpoint is configured for the port on which SQL server is listening ( generally 1433) on the VM machine.
为VM机器上SQL Server侦听的端口(通常为1433)配置了端点。
Ports are opened on the VM machine.
在VM计算机上打开了端口。 Even though as per the documentation Cloud adaptor takes care of opening the firewall ports, it doesn't work for the normal connections which you are trying to make.
即使按照文档说明,云适配器负责打开防火墙端口,但对于您尝试建立的常规连接而言,它不起作用。 Just type in ” wf.msc” and create a rule for both outgoing and incoming for TCP port 1433.
只需输入“ wf.msc”,并为TCP端口1433创建一个用于传出和传入的规则。
As soon as you are done with these two, you would be able to connect to the SQL server on the VM machine.
完成这两个操作后,您将能够连接到VM计算机上的SQL Server。
According to your description, I guess your SQL database is a Azure service, not install SQL on Azure VM. 根据您的描述,我猜您的SQL数据库是Azure服务,而不是在Azure VM上安装SQL。
If I understand it correctly, we should check SQL database firewall settings and confirm the name of your database . 如果我理解正确,我们应该检查SQL数据库防火墙设置并确认数据库的名称 。
The error code means, this error could occur because either the firewall on the server has refused the connection or the server is not configured to accept remote connections.
错误代码表示,可能发生此错误是因为服务器上的防火墙拒绝了连接或服务器未配置为接受远程连接。
We can via Azure Portal to check the firewall settings: 我们可以通过Azure Portal检查防火墙设置:
Make sure the Allow access to Azure Services
is ON , And make sure your client IP address have added to the Client IP address list. 确保“
Allow access to Azure Services
处于“ 打开”状态 ,并确保您的客户端IP地址已添加到“客户端IP地址”列表中。
Also we should confirm the name of your database, make sure we are connect to the right SQL database. 另外,我们应该确认您的数据库名称 ,确保我们已连接到正确的SQL数据库。
I have also made my port 1433 open for sql.
我还为SQL打开了端口1433。 But when I try to connect to database this error shows up.
但是,当我尝试连接数据库时,会出现此错误。
You also need to enable 1433 port in Network Security Group which related to your VM. 您还需要在Network Security Group中启用与VM相关的1433端口。 Steps below are for your reference.
以下步骤供您参考。
Server name format. 服务器名称格式。
[IP address/dns name],1433
For example, 例如,
13.81.50.123,1433
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.