I'm trying to run Google Cloud SQL proxy locally like this:
$ ./cloud_sql_proxy -instances project-name:region-name:instance-id tcp:3306
But it's returning
google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for mor information.
My Google Cloud SDK is already installed and logged in to Google.
How do I fix this?
Two problems may be generating your problem.
To find what is login, using:
1. You haven't application default credentials
If you have a recent version of gcloud you will get:
To make your local application use your credentials you need to do (ref):
If you don't see this warning consider updating gcloud, with:
2. You haven't defined your project
After login, you should see:
Once again two solutions:
a. Associate a project
If you are not seeing this, do (ref):
b. Use global
--project
flag in the callIn your command associate a project: