2

Last week I tried to setup Google Cloud for a NodeJS API and Cloud SQL database. Overall it works fine, but I can't access my Cloud SQL database. The authorization of the SQL database shows that all apps within the current project are granted to access the database. Unfortunality, this is not true. I need to granted the IP addresses of the instances from the App Engine. The IP adressess of the instances constantly changes after I deploy a newer version of the the API.

Does anybody have a solution to get access from the App Engine to the Cloud SQL database. It's very annoying to add constant the instance ip address to grant the database.

Sample here

Thank you in advance!

Jelle

  • I wrote a tutorial [CONNECTING FROM APP ENGINE TO CLOUD SQL USING TCP AND UNIX DOMAIN SOCKETS](https://stackoverflow.com/questions/60025858/not-able-to-connect-app-engine-to-cloud-sql-for-mysql-instance/60026082?noredirect=1#comment106160055_60026082) – marian.vladoi Feb 10 '20 at 12:29

1 Answers1

0

I was going to suggest to assign a static IP to the app engine, but seems like it's not possible in App engine (it's possible in compute engine though). So lets tackle the root of the problem, you being unable to access cloud sql from App engine, are you sure you followed the instructions of the following link to the letter?

https://cloud.google.com/nodejs/getting-started/using-cloud-sql

This might solve your connection issue if you haven't.

Kalana Demel
  • 3,220
  • 3
  • 21
  • 34