Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

socketPath equivalent for mySQL connection in TypeORM

I created a mySQL database in the google cloud and I'm trying to connect to the mySQL instance from firebase according to this question on stackoverflow we need to set the socketPath property of mySql connection but TypeORM hasn't the same property wondering is there any other alternative?

like image 446
user4092086 Avatar asked Jan 20 '26 03:01

user4092086


1 Answers

What you are looking for lives in "extra" in your ormconfig. Here's an example that connects up to cloud SQL successfully for me:

{
"type": "mysql",
"extra": {
    "socketPath": "/cloudsql/<project>:<region>:<database>"
    },
"port": 3306,
"username": "myuser",
"password": "secret",
"database": "mydb"
}
like image 132
Javier Muniz Avatar answered Jan 21 '26 17:01

Javier Muniz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!