本文介绍了无法从第三方托管连接的Web应用程序为sql Azure数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试没有成功连接这是一个第三方的虚拟主机上承载的Web应用程序(在这种情况下,GoDaddy的)。我不知道,如果它是一个连接字符串的问题或SQL蔚蓝的权限问题,但我希望能找到一些建议。

I'm attempting to connect a web application that is hosted on a third party web host (in this case, GoDaddy) without any success. I'm not sure if it is a connection string issue or an sql azure permissions issue, but I'm hoping to find some advice.

错误我收到:


建立SQL Server的连接发生网络相关的或特定于实例的错误,服务器未找到或无法访问。验证实例名称是否正确,以及SQL Server配置为允许远程连接。 (provider:TCP提供程序,error:0 - 连接尝试失败,因为连接的方没有正确一段时间后响应或已建立的连接失败,因为连接的主机没有反应。)

目前,Web应用程序是什么更多的,ASP的MVC电影教程中的。 GoDaddy的托管帐户是一个网格托管帐户使用asp.net 4.0(它解析为一个IP地址)。

At the moment, the web application is nothing more that the ASP MVC Movie tutorial found here. The GoDaddy hosting account is a grid hosting account (which does resolve to a single IP address) using asp.net 4.0.

我可以得到Web应用程序的建立,模仿的SQL Azure数据库的我已经创建了第三方主机上的SQL数据库中提取数据。我也可以通过使用Visual Studio 2010中提供的Web开发服务器产生的问题是连接到SQL Azure数据库时,我尝试连接直播网站/应用程序(在GoDaddy的)到SQL Azure数据库。

I can get the web application to pull data from an sql database set up on the third party host that mimics the sql azure database the I have created. I can also connect to the sql azure database using the web development server provided by Visual Studio 2010. The issue arises when I try to connect the live site/application (on GoDaddy) to the SQL Azure database.

我已经安装防火墙中为SQL Azure数据库允许(不使用真实IP的,但你的想法)连接方式:

I have setup the firewall for the SQL Azure database to allow connections for (not using real IP's but you'll get the idea):

微软服务(0.0.0.0)

我的本地开发机(87.187.187.87)

第三方网站的IP地址(97.197.197.197)

Microsoft services (0.0.0.0)
My local dev machine (87.187.187.87)
The IP address of the third party website (97.197.197.197)

我使用调试和发布相同的连接字符串,导致我相信这个问题是不是与这一点,但我也允许该网站的IP地址;所以我在有点茫然,这个问题的原因。

I'm using the same connection string for Debug and Release which leads me to believe that the issue is not with that, but I've also allowed the IP address of the website; so I'm at a bit of a loss as to the cause of the issue.

某些连接字符串的我曾尝试:

Some connection strings the I have tried:

这一个是基于参考字符串我看到的谷歌在


Server=tcp:servername.database.windows.net;Database=myDatabase;Trusted_Connection=False;User ID=userName@servername;Password=password;MultipleActiveResultSets=True;Encrypt=True;

This one is based on reference strings I have seen on the Googles

Server=tcp:servername.database.windows.net;Database=myDatabase;Trusted_Connection=False;User ID=userName@servername;Password=password;MultipleActiveResultSets=True;Encrypt=True;

此人正在使用Intial目录,而不是数据库和一些小的其他方面的差异


服务器= TCP: 服务器名 .database.windows.net;初始目录= MyDatabase的;坚持安全信息= TRUE;用户ID=userName@servername;Password=password;MultipleActiveResultSets=False;

This one is using "Intial Catalog" instead of "Database" and some minor other differences

Server=tcp:servername.database.windows.net;Initial Catalog=myDatabase;Persist Security Info=True;User ID=userName@servername;Password=password;MultipleActiveResultSets=False;

这一次下降从用户ID

的@servername
Server=tcp:servername.database.windows.net;Database=myDatabase;Trusted_Connection=False;User ID=userName;Password=password;MultipleActiveResultSets=True;Encrypt=True;

This one drops the "@servername" from the User ID

Server=tcp:servername.database.windows.net;Database=myDatabase;Trusted_Connection=False;User ID=userName;Password=password;MultipleActiveResultSets=True;Encrypt=True;

我已经用了一些别人不要使用TCP:但得到一个命名管道错误,我发现了,我应该用TCP:对于SQL蔚蓝的连接。不过,现在我得到一个TCP错误,所以谁知道最新的权利。

I have used some others the don't use "tcp:" but that gets a named pipes error and I found out the I should use "tcp:" for sql azure connections. However, now I get a TCP error, so who knows whats right.

所有这些连接字符串在我的开发环境的工作,但他们都不在现场环境中工作。我要么有很简单的东西不正确,或者是完全无视这一事实,有一些根本不可能之间的第三方托管的Web应用程序及SQL Azure连接。

All of these connections strings work in my dev environment, but none of them work in a live environment. I either have something very simple incorrect, or am completely oblivious to the fact that there is something fundamental impossible in the connection between a third party hosted web application and sql azure.

任何意见将是极大的AP preciated。

Any advice would be greatly appreciated.

感谢。

[更新] -

要别人试图解决这一问题;你是不幸的是出于运气。 GoDaddy的不允许从它的共享/格托管帐户外部数据库的连接。你可以做到这一点,如果你有一个专用的服务器,但不共享。

To anyone else trying to solve this issue; you are unfortunately out of luck. GoDaddy does not allow external database connections from its shared/grid hosting accounts. You can do it if you have a dedicated server, but not shared.

感谢那些谁回答我的问题。你的意见(,而不是让我顺利解决该问题)确实为我提供了我需要找到问题的根源的建议。

Thanks to those who responded to my question. Your advice (while not allowing me to resolve the issue successfully) did provide me with the advice I needed to get to the root cause of the problem.

这么多的使用GoDaddy的网站主机及SQL Azure可伸缩分贝的想法。这也许是最好的,现在因为我使用SQL的全文检索和SQL Azure不在写这篇文章的时候支持。

So much for the idea of using GoDaddy for the site hosting and SQL azure for a scalable db. It's probably for the best right now since I am using SQL's full-text search and SQL Azure doesn't support it at the time of this writing.

推荐答案

你试过全力开拓SQL Azure的防火墙(设置为0.0.0.0-255.255.255.255)?这将至少让你知道,如果防火墙是或不是问题。

Have you tried fully opening up the SQL Azure firewall (set to 0.0.0.0-255.255.255.255)? This will at least let you know if the firewall is or isn't the issue.

另外要考虑的是,你的Web应用程序需要做端口1433的出站连接是否有可能,这个端口被封锁GoDaddy的?

The other thing to consider is that your web app needs to make its outbound connection on port 1433. Is it possible that this port is blocked by GoDaddy?

这篇关于无法从第三方托管连接的Web应用程序为sql Azure数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 22:30