对于连接URL 'postgresql://db_user:db_passwd@localhost:5432/db_name'
失败
抛出psycopg2.OperationalError could not connect to server: Connection refused
即使在blog-post
答案 0 :(得分:1)
在具有ubuntu的AWS-EC2上,使用cmd启动gramex:
docker run --network=host \
--name my-instance \
-d -i -t -p 9998:9998 \
-v "$(pwd)":"$(pwd)" -w "$(pwd)" \
gramener/gramex
它允许熊猫通过连接URL 'postgresql://db_user:db_passwd@localhost:5432/db_name'
连接到在主机上运行的postgresql服务器。
参数:--network=host
使它起作用。