John-no1
John-no1

Reputation: 91

Google API Insufficient authentication scope for MySQL proxy on Google Cloud

I am having a problem starting proxy for Google SQL.

I installed proxy like this:

$ wget https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64

$ mv cloud_sql_proxy.linux.amd64 cloud_sql_proxy

$ chmod +x cloud_sql_proxy

$ sudo mkdir /cloudsql; sudo chmod 777 /cloudsql

Problem is when I try to run proxy:

$ ./cloud_sql_proxy -dir=/cloudsql -instances=myproject:us-central1:mydb

I receive error message:

googleapi: Error 403: Request had insufficient authentication scopes., forbidden

I enabled Google API as described in documentation. Both 'Compute Engine' and 'Cloud SQL' are in the same project. I expected there will be no need to additional authentication.

Please advise.

Thank you.

Upvotes: 2

Views: 2342

Answers (1)

John-no1
John-no1

Reputation: 91

Thanks to John Hanley's suggestion, I fixed the problem.

Issue was with missing permissions for API. I added them here: Compute Engine > VM instance details > Cloud API access scopes. Permission for all APIs was disabled and after enabling them, I was able to successfully run Google SQL proxy.

Upvotes: 7

Related Questions