尝试使用以下设置连接时,我在 App Engine 上收到 socket:operation not permitted
错误,但在使用 cloud-sql-proxy 时不会在本地出现。以下代码在本地有效,但不适用于 App Engine:
connString = "user=USER_NAME password=PASSWORD host=/cloudsql/INSTANCE_NAME dbname=DB_NAME"
DBCon, err2 = sql.Open("postgres", connString)
app engine和cloud sql都在同一个项目中。有人对我缺少的东西有任何见解吗?
最佳答案
很遗憾,AppEngine 标准尚不支持 Cloud SQL+postgres:
“注意:不支持从 App Engine 标准环境应用程序连接到 PostgreSQL 实例”
https://cloud.google.com/sql/docs/postgres/connect-app-engine
关于postgresql - 套接字 : operation not permitted when connecting to cloudsql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44863620/