2013-04-06 63 views
1

EC2上的我的Web應用程序無法連接到AWS RDS Db實例。AWS EC2無法打開與SQL Server的連接

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應用程序。

使用我當地的SSMS,我可以連接和編輯AWS RDS上的數據。

我的本地機器上,我也指出我的Visual Studio應用程序的AWS RDS實例,它工作得很好。

現在,當我將應用程序部署到EC2時,應用程序無法連接到AWS RDS。

使用AWS Toolkit for net,我添加了數據庫安全組的權限,並授予了EC2 IP地址和私有IP的權限。但沒有運氣。

請幫忙......

回答

1

檢查您要連接的區域。

我最初創建時,數據庫在西部地區。我的地方還在繼續連接西部地區。

當我給了所有必要的權限,我把它給了東部地區的數據庫。而我的代碼應用程序仍然指向西部地區。呃我。