Monday, October 30, 2017

[google-cloud-sql-discuss] Connect to Cloud SQL (MySQL) fails via proxy from external Windows 10 Client

Dear all,

I'm trying to connect from an external Windows 10 client to CloudSQL (MySQL) and get stuck in the authentification process.

What I did so far:

- Created a folder "C:\cloudsql"
- put the private key "xxx-project-24178a0daa8g.json" into this folder
- put the file "cloud_sql_proxy.exe" into this folder

Then I go to the windows command prompt and go to the folder C:\cloudsql

Now I try to start the proxy by the following command. To do this I follow the example from the following article:
https://cloud.google.com/sql/docs/mysql/sql-proxy#invocations

The example for windows is:
cloud_sql_proxy.exe -instances=[INSTANCE_CONNECTION_NAME]=tcp:3306
mysql
-u [USER_NAME] --host 127.0.0.1
I wonder why in this example the path to the private key is not mentioned.

So my command for starting the proxy is as follows:
cloud_sql_proxy.exe -instances=xxx-project:europe-west3:xxx-instance=tcp:3306 mysql -u root --host 127.0.0.1

After hitting "enter" I get an error:

" google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information."

So I created the environment variable "GOOGLE_APPLICATION_CREDENTIALS" with the value of the path and filename of the private key. It's:
"C:\cloudsql\xxx-project-24178a0daa8g.json"

I still get the same message " google: could not find default credentials. See [...]".

How can I start the proxy on a windows 10 client and use it for the connection to my cloud sql?

Best regards
Jorg




--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/c2ca152e-0c61-48af-bec2-07161daec615%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment