在Azure VM中连接到VS2008中的SQL Server 2008

时间:2021-10-04 17:33:48

I have successfully created Azure VM with SQL Server 2008. I went ahead and added Web server roles. I also copied my working web application on VM by remoting in.

我已经使用SQL Server 2008成功创建了Azure VM。我继续添加了Web服务器角色。我还通过远程复制在VM上复制了我的工作Web应用程序。

I can run queries from SQL Server Management Studio.

我可以从SQL Server Management Studio运行查询。

I made corresponding changes to my web config file but I get error

我对我的网络配置文件做了相应的更改,但是我收到了错误

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

建立与SQL Server的连接时发生与网络相关或特定于实例的错误。服务器未找到或无法访问。验证实例名称是否正确,以及SQL Server是否配置为允许远程连接。 (提供程序:命名管道提供程序,错误:40 - 无法打开与SQL Server的连接)

2 个解决方案

#1


0  

You should make sure that port 1433 on the virtual network is open (unless you changed the default port for SQL Server) and you should also make sure you have SQL authentication enabled for your server.

您应确保虚拟网络上的端口1433已打开(除非您更改了SQL Server的默认端口),并且还应确保为服务器启用了SQL身份验证。

This question How do I fix the error 'Named Pipes Provider, error 40 - Could not open a connection to' SQL Server'? also has some possible solutions.

此问题如何修复错误'命名管道提供程序,错误40 - 无法打开与'SQL Server'的连接?也有一些可能的解决方案。

Running your own SQL Server on a VM in Azure isn't much different from running it on a local server. You still need to manage everything like port openings, services running on you host and so on.

在Azure中的VM上运行自己的SQL Server与在本地服务器上运行它没有太大区别。您仍然需要管理端口开放,在主机上运行的服务等所有内容。

#2


0  

4 moving parts:

4个运动部件:

  1. VM should have public IP, or you should have some kind of routing to the VM.
  2. VM应该具有公共IP,或者您应该具有到VM的某种路由。

  3. Network Security Group should permit traffic on the port of interest (1433).
  4. 网络安全组应允许在感兴趣的端口上进行通信(1433)。

  5. Firewall on the VM should allow traffic on the port of interest.
  6. VM上的防火墙应该允许感兴趣的端口上的流量。

  7. Application on the VM should listen to the traffic on the port of interest.
  8. VM上的应用程序应该监听感兴趣的端口上的流量。

#1


0  

You should make sure that port 1433 on the virtual network is open (unless you changed the default port for SQL Server) and you should also make sure you have SQL authentication enabled for your server.

您应确保虚拟网络上的端口1433已打开(除非您更改了SQL Server的默认端口),并且还应确保为服务器启用了SQL身份验证。

This question How do I fix the error 'Named Pipes Provider, error 40 - Could not open a connection to' SQL Server'? also has some possible solutions.

此问题如何修复错误'命名管道提供程序,错误40 - 无法打开与'SQL Server'的连接?也有一些可能的解决方案。

Running your own SQL Server on a VM in Azure isn't much different from running it on a local server. You still need to manage everything like port openings, services running on you host and so on.

在Azure中的VM上运行自己的SQL Server与在本地服务器上运行它没有太大区别。您仍然需要管理端口开放,在主机上运行的服务等所有内容。

#2


0  

4 moving parts:

4个运动部件:

  1. VM should have public IP, or you should have some kind of routing to the VM.
  2. VM应该具有公共IP,或者您应该具有到VM的某种路由。

  3. Network Security Group should permit traffic on the port of interest (1433).
  4. 网络安全组应允许在感兴趣的端口上进行通信(1433)。

  5. Firewall on the VM should allow traffic on the port of interest.
  6. VM上的防火墙应该允许感兴趣的端口上的流量。

  7. Application on the VM should listen to the traffic on the port of interest.
  8. VM上的应用程序应该监听感兴趣的端口上的流量。