I am trying to establish a connection locally for a second generation sql server instance.
Proxy Server Call
./cloud_sql_proxy -dir=/cloudsql -instances=status-1268:us-central1:status-dev=tcp:3306 & mysql -u status_stg
I donβt understand a bit how to properly configure service accounts from the API section, so I tried to use both default values, the default service account for the App Engine application and the default Compute engine service account. I also created a new service account. For each of them, I assigned the ID of the Editor and Owner service account from the Management Permissions section. Perhaps there is another way to enable the Cloud API Admin API for these accounts?
Exiting the proxy server when my service tries to talk to the database:
./cloud_sql_proxy -dir=/cloudsql -instances=status-1268:us-central1:status- dev=tcp:3306 & mysql -u status_stg --host 127.0.0.1 ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (61) 2016/04/04 11:26:58 Open socket for "status-1268:us-central1:status-dev" at "127.0.0.1:3306" 2016/04/04 11:26:58 Socket prefix: /cloudsql 2016/04/04 11:27:10 Got a connection for "status-1268:us-central1:status-dev" 2016/04/04 11:27:11 couldn't connect to "status-1268:us-central1:status-dev": googleapi: Error 403: The client is not authorized to make this request., notAuthorized 2016/04/04 11:29:08 Got a connection for "status-1268:us-central1:status-dev" 2016/04/04 11:29:08 couldn't connect to "status-1268:us-central1:status-dev": googleapi: Error 403: The client is not authorized to make this request., notAuthorized
Thoughts on what to look for? I think I'm missing something basic here by setting up service accounts.
(In general, for my project, I run the node.js express application and hope to connect it to the SQL instance of the 2nd level sql server without exposing it to 0.0.0.0, as I am currently working)
thanks
google-app-engine google-cloud-platform google-cloud-sql
georges
source share