我将Prisma与Cloud Run一起使用&云SQL。在将DATABASE_URL
提供给prisma.schema
之后,它在运行时向我抛出一个错误。
Can't reach database server at `(/cloudsql/project-name:us-east1:database-id)`:`5432`
Please make sure your database server is running at `(/cloudsql/project-name:us-east1:database-id)`:`5432`."
- 数据库:Postgres
- 提供的url
DATABASE_URL
:postgresql://username:password@localhost/databasename?host=(/cloudsql/project-name:us-east1:database-id)
连接有什么问题?我是否未能正确构建DATABASE_URL
?
我去掉了host
参数/cloudsql/project-name:us-east1:database-id
周围的括号()
,一切都开始按预期工作。
之前(带括号(
postgresql://username:password@localhost/databasename?host=(/cloudsql/project-name:us-east1:database-id)
之后(无括号(
postgresql://username:password@localhost/databasename?host=/cloudsql/project-name:us-east1:database-id