AWS EC2无法打开到SQL Server的连接 [英] AWS EC2 Could not open a connection to SQL Server

查看:289
本文介绍了AWS EC2无法打开到SQL Server的连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在EC2上我的Web应用程序是无法连接到AWS RDS DB实例。

My web application on EC2 is not able to connect to AWS RDS Db instance.

error: 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Win32Exception (0x80004005): The network path was not found

我已经托管在EC2上的Web应用程序。

I have hosted a web application on EC2.

使用设我的本地SSMS,我能够在AWS RDS连接和编辑数据。

Usin my local SSMS, I am able to connect and edit data on the AWS RDS.

在我的本地机器上,我还指着我的Visual Studio应用程序的AWS RDS实例,它的工作就好了。

on my local machine, I also pointed my Visual Studio application to the AWS RDS instance and it worked just fine.

现在,当我部署我的应用程序,以EC2,该应用程序是无法连接到AWS RDS。

Now, when I deployed my application to EC2, the application is not able to connect to the AWS RDS.

使用AWS工具包网,我已经添加权限,数据库安全组和授予权限EC2 IP地址和私有IP为好。但没有运气。

Using the AWS Toolkit for net, I have added permissions to the DB Security groups and granted rights to the EC2 Ip address and Private Ip as well. But no luck.

请帮忙......

推荐答案

检查您要连接到该地区。

Check the region you are connecting to.

我最初创建的,在西部地区的数据库。而我的地方正在继续连接到西部地区。

I had initially created, the database in west region. And my local was continuing to connect to west region.

当我给了所有必要的权限,我把它给东部地区的数据库。我的code应用程序仍指向西部地区。咄我。

And when I gave all necessary permissions, I gave it to the database in east region. and my code application was still pointing to the west region. duh me.

这篇关于AWS EC2无法打开到SQL Server的连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆