gpt4 book ai didi

google-cloud-sql - Google Cloud SQL 的典型 ormconfig.json 文件?

转载 作者:行者123 更新时间:2023-12-01 22:08:15 25 4
gpt4 key购买 nike

我已经尝试了几个小时了。 Google Cloud SQL 与 TypeORM 配合使用的 ormconfig.json 文件应该是什么?我设法让它在本地使用数据库的 IP(使用 mysql 工作台和 Google 云代理并将我的 IP 列入白名单),但我不知道应用程序引擎的连接详细信息应该是什么。

{
"name": "default",
"type": "mysql",
"host": "/cloudsql/[project:region:instance]",
"port": "3306",
"username": "root",
"password": "xxxx",
"database": "yyy",
"synchronize": true,
"logging": false,
"entities": [
"modules/**/*.entity.js"
]
}

{
"name": "default",
"type": "mysql",
"extra": {
"socketPath": "/cloudsql/[project:region:instance]"
},
"username": "root",
"password": "xxxx",
"database": "yyy",
"synchronize": true,
"logging": false,
"entities": [
"modules/**/*.entity.js"
]
}

还是其他什么?

非常感谢!

最佳答案

对于那些感兴趣的人,这里是解决方案:

{
"name": "default",
"type": "mysql",
"extra": {
"socketPath": "/cloudsql/[project:region:instance]"
},
"username": "root",
"password": "xxxx",
"database": "yyy",
"synchronize": true,
"logging": false,
"entities": [
"dist/**/*.entity.js"
]
}

请注意,我还更改了实体路径

关于google-cloud-sql - Google Cloud SQL 的典型 ormconfig.json 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47895612/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com