I have been trying for hours. What should be the ormconfig.json file for Google Cloud SQL working with TypeORM? I managed to get it working with the IP of the DB locally (with mysql workbench and Google cloud proxy and whitelisting my ip) but I don't know what the connection details should be for app engine.
{
"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"
]
}
or
{
"name": "default",
"type": "mysql",
"extra": {
"socketPath": "/cloudsql/[project:region:instance]"
},
"username": "root",
"password": "xxxx",
"database": "yyy",
"synchronize": true,
"logging": false,
"entities": [
"modules/**/*.entity.js"
]
}
or anything else?
Thanks a lot!
For those interested, here is the solution:
{
"name": "default",
"type": "mysql",
"extra": {
"socketPath": "/cloudsql/[project:region:instance]"
},
"username": "root",
"password": "xxxx",
"database": "yyy",
"synchronize": true,
"logging": false,
"entities": [
"dist/**/*.entity.js"
]
}
Note that I also changed the entities
path
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With