1

我正在尝试连接到 AWS RDS 中的 SQL Server 2012 数据库。代码在 Debug 中工作,它倾向于证明连接字符串、AWS 配置……都很好。我使用 FTP 检查了部署在 Azure 中的连接字符串,一切都很好,但是当我调用 Connection.Open() 时,我收到以下错误(堆栈跟踪的相关部分):

[01/26/2016 12:45:00 > 8c2620: INFO] System.Data.SqlClient.SqlException (0x80131904): 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: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) ---> System.ComponentModel.Win32Exception (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
[01/26/2016 12:45:00 > 8c2620: INFO]    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

我尝试在 Azure 中设置一个网络安全组(允许所有端口/所有 IP/TCP/UDP 输入/输出)。它没有帮助,但我无法完全理解 WebJob 是否受到此安全组的影响(我是 Azure 的新手,发现界面有点混乱)。有没有办法将政策与工作联系起来,或者政策是否适用于服务器范围?

我应该提到我正在使用 AWS 和 Azure 的免费帐户(这可能会限制我的选择?)

有没有人遇到这个问题?有没有人有任何提示?

提前致谢

4

2 回答 2

3

将此添加为答案,以便其他人也可能受益

首先检查您是否拥有托管 RDS 实例时创建的默认数据库安全组。

如果是这样,根据此AWS 链接,他们要求您实际删除数据库安全组。

您应该尝试删除这些,然后再次检查连接。

希望这可以帮助。

于 2016-01-26T14:53:45.330 回答
0

好的,伙计们,试试这个 我很确定它对

有用 1. 转到安全组。
2. 选择默认组。
3. 转到入站组。
4. 单击编辑,然后将源选项从自定义更改为任意位置。
5. 保存。

就是这样,
如果有效请回复。

莫哈巴萨姆

于 2018-03-10T17:01:42.293 回答