Sockets /cloudsql/are available only in the regular App Engine. Managed virtual machines are regular virtual machines, so you must use the external IP address of Cloud SQL instances to connect to Cloud SQL. External IP must be whitelisted. The external IP address is displayed in the Developer Console and can also be retrieved using the gcloud CLI tool.
Two options to avoid whitelisting the IP addresses of GCE virtual machines:
- Switch to use only SSL connections for IP connection and whitelist 0.0.0.0/0.
- Secure all traffic to Cloud SQL using a virtual machine that launches a TCP proxy server (HAProxy), for example.
We know that none of them is a very satisfactory solution .: - (
source
share