简体   繁体   中英

Google Cloud SQL Docker Proxy

I am trying to connect to my Cloud SLQ (Postgres) instance from my local environment (OSX) using the Google Cloud SQL Docker Proxy as documented here . When running the proxy I get:

google: could not find default credentials.

Note that I am running gcloud on my local environment within the right project and having authenticated through the application-default login. I understand that in similar questions this is what solved the issue however this is not my case.

Specifying the absolute path of the key file solved my problem.

Here is a good resource for this issue: https://cloud.google.com/sql/docs/mysql/connect-admin-proxy

Look at where you specify PATH_TO_KEY_FILE here:

   docker run -d \
      -v PATH_TO_KEY_FILE:/config \
      -p 127.0.0.1:3306:3306 \
      gcr.io/cloudsql-docker/gce-proxy:1.19.1 /cloud_sql_proxy \
      -instances=INSTANCE_CONNECTION_NAME=tcp:0.0.0.0:3306 \
      -credential_file=/config

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM