简体   繁体   English

无法将aws RDS连接到本地django

[英]Unable to connect aws RDS to django local

I am trying to connect my local django application to amazon RDS (tried with both MySQL and PostgreSQL) but I am not able to connect as it shows the following errors, Currently seeking answer for PostgreSQL.我正在尝试将我的本地 django 应用程序连接到亚马逊 RDS(尝试使用 MySQL 和 PostgreSQL)但我无法连接,因为它显示以下错误,目前正在寻找 PostgreSQL 的答案。

In my Settings.py :在我的Settings.py中:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'database_name',
        'USERNAME': 'my_username',
        'PASSWORD': 'my_password',
        'HOST': 'database-abc.xxx.us-region-yyy.rds.amazonaws.com',
        'PORT': '5432',
    }
}

In AWS database configuration:在 AWS 数据库配置中:

在此处输入图像描述

I get this error:我收到此错误:

django.db.utils.OperationalError: could not connect to server: Connection timed out (0x0000274C/10060) django.db.utils.OperationalError:无法连接到服务器:连接超时(0x0000274C/10060)
Is the server running on host "database-abc.xxx.us-region-yyy.rds.amazonaws.com" (69.420.00.121) and accepting TCP/IP connections on port 5432?服务器是否在主机“database-abc.xxx.us-region-yyy.rds.amazonaws.com”(69.420.00.121) 上运行并在端口 5432 上接受 TCP/IP 连接?

I referred to all the available data but still am unable to resolve this issue!我参考了所有可用的数据,但仍然无法解决这个问题!

Thanks in advance!提前致谢!

In the VPC security group go to inbound settings create a new rule with the Postgres connection type, not HTTP and make it available from every.在 VPC 安全组 go 中,入站设置使用Postgres连接类型创建一个新规则,而不是 HTTP 并使其从每个可用。

Note: don't forget to make accessibility to the database to be public.注意:不要忘记公开数据库的可访问性。

入站规则示例

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

相关问题 AWS RDS MS SQL 无法连接 - AWS RDS MS SQL Unable to connect 无法连接到我本地笔记本电脑上 SMSS 上的 AWS RDS MS SQL SERVER - Unable to connect to my AWS RDS MS SQL SERVER on SMSS on my local laptop 无法连接到 AWS RDS 上的 SQL 服务器 - Unable to connect to SQL Server on AWS RDS 无法连接到位于 [AWS RDS ADDRESS] 的 Mysql 无法连接到本地主机 - failed to connect to Mysql at [AWS RDS ADDRESS] unable to connect to localhost 无法使用 PyODBC 和 AWS Lambda 连接 RDS SQL 服务器 - Unable to connect with RDS SQL Server using PyODBC & AWS Lambda 无法从外部源连接到 AWS RDS Aurora (MySQL) 集群 - Unable to connect to AWS RDS Aurora (MySQL) Cluster from external source AWS Lambda in Java 无法使用连接钱包连接到Oracle RDS - AWS Lambda in Java unable to connect to Oracle RDS using connection wallet 如何将 DJANGO 应用程序连接到通过 SSH 连接到堡垒的 AWS RDS - how to connect DJANGO app to AWS RDS connected to a bastion via SSH 无法连接 .NET 6-based AWS Lambda function 到 AWS RDS (MySql) 数据库 - Unable to connect .NET 6-based AWS Lambda function to AWS RDS (MySql) database 无法连接到 AWS RDS 服务器:无法连接到服务器:连接超时 (0x0000274C/10060) - Unable to connect to AWS RDS server: could not connect to server: Connection timed out (0x0000274C/10060)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM