简体   繁体   English

无法连接到 AWS RDS 上的 SQL 服务器

[英]Unable to connect to SQL Server on AWS RDS

I created a new SQL Server Express with 'admin' username & password.我使用“admin”用户名和密码创建了一个新的 SQL Server Express。

I added inbound rules in Security Groups to allow all traffic from my laptop's IP address & default gateway (Do I need to do both Ipv4 address & also the gateway for connectivity to go thru?)我在安全组中添加了入站规则,以允许来自笔记本电脑 IP 地址和默认网关的所有流量(我是否需要同时执行 Ipv4 地址和网关以连接到 go 直通?)

When I tried to connect to the newly created SQL Server via SSMS using SQL Server authentication with username admin & password that I used while creating the Instance.当我尝试使用 SQL 服务器身份验证通过 SSMS 连接到新创建的 SQL 服务器时,我在创建实例时使用了用户名admin和密码。 The connection fails with the error message below.连接失败并显示以下错误消息。 What am I doing wrong?我究竟做错了什么?

TITLE: Connect to Server标题:连接到服务器

Cannot connect to sql-xxxxxxxxxxxxx.rds.amazonaws.com.无法连接到 sql-xxxxxxxxxxxxx.rds.amazonaws.com。

A.network-related or instance-specific error occurred while establishing a connection to SQL Server. A. 与 SQL 服务器建立连接时发生网络相关或特定于实例的错误。 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.验证实例名称是否正确以及 SQL 服务器是否配置为允许远程连接。 (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53) (提供商:命名管道提供商,错误:40 - 无法打开与 SQL 服务器的连接)(Microsoft SQL 服务器,错误:53)

  1. Check Public access for RDS Instance : You are trying to access the RDS instance from your laptop - means trying to access RDS from outside VPC that is hosting the instance.检查 RDS 实例的公共访问:您正在尝试从笔记本电脑访问 RDS 实例 - 意味着尝试从托管实例的外部 VPC 访问 RDS。 In that case you must enable public access to the RDS instance.在这种情况下,您必须启用对 RDS 实例的公共访问。 This would assign a public IP. You can modify this feature after creating the RDS instance too.这将分配一个公共 IP。您也可以在创建 RDS 实例后修改此功能。
  2. Security Group rules : Port 1433 must be opened for the IP address you would like to access from - your home/work IP address.安全组规则:必须为您要访问的 IP 地址打开端口 1433 - 您的家庭/工作 IP 地址。 You can select 'My IP' on source when creating Security Group rules, this will set your IP automatically as source.您可以在创建安全组规则时在来源上输入 select '我的 IP',这将自动将您的 IP 设置为来源。

PS: Please make sure the su.net where RDS instance is hosted does not have any blocks at NACL level and su.net's route table has route to inte.net traffic, through Inte.net Gateway. PS:请确保托管 RDS 实例的 su.net 在 NACL 级别没有任何块,并且 su.net 的路由表具有通过 Inte.net 网关到 inte.net 流量的路由。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM