Google API Insufficient authentication scope for MySQL proxy on Google Cloud

2k views Asked by At

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.

1

There are 1 answers

0
John-no1 On

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.