Connect to Cloud SQL (MySQL) fails via proxy from external Windows 10 Client

988 views
Skip to first unread message

Jörg Hartgen

unread,
Oct 30, 2017, 5:58:52 PM10/30/17
to Google Cloud SQL discuss
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:

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




Kamran (Google Cloud Support)

unread,
Oct 30, 2017, 10:03:30 PM10/30/17
to Google Cloud SQL discuss

Cloud you try using -credential_file=<PATH_TO_KEY_FILE> with the command running Cloud SQL proxy to see if it resolves your issue?

Jörg Hartgen

unread,
Oct 31, 2017, 5:19:49 PM10/31/17
to Google Cloud SQL discuss
I already tried "-credential_file=<PATH_TO_KEY_FILE>", but it did not work.

But: After a restart of my computer the proxy works. The reason for this is that the computer needs a restart for the environment variable to become active.

Kamran (Google Cloud Support)

unread,
Oct 31, 2017, 5:30:37 PM10/31/17
to google-cloud...@googlegroups.com

Glad to hear that you resolved the issue and thanks for sharing your solution that can help other users who would be experiencing the similar issue. 
Reply all
Reply to author
Forward
0 new messages