【发布时间】:2020-11-07 23:32:26
【问题描述】:
我创建了一个 RDS 实例(Postgres,免费层,在默认 VPC 中)并选择了公共访问权限。现在,我正在尝试像这样在 Python 中连接到它:
import psycopg2 as ps
# define credentials
credentials = {'POSTGRES_ADDRESS' : '', # change to your endpoint
'POSTGRES_PORT' : '', # change to your port
'POSTGRES_USERNAME' : '', # change to your username
'POSTGRES_PASSWORD' : '', # change to your password
'POSTGRES_DBNAME' : ''} # change to your db name
# create connection and cursor
conn = ps.connect(host=credentials['POSTGRES_ADDRESS'],
database=credentials['POSTGRES_DBNAME'],
user=credentials['POSTGRES_USERNAME'],
password=credentials['POSTGRES_PASSWORD'],
port=credentials['POSTGRES_PORT'])
cur = conn.cursor()
但是,这会超时。我究竟做错了什么?我相信我输入了上面的所有凭据,所以这可能是 AWS 方面的问题吗?如果您需要更多信息,请告诉我。
谢谢!
【问题讨论】:
-
评论不用于扩展讨论;这个对话是moved to chat。
标签: amazon-web-services amazon-rds