Tuesday, October 31, 2017

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


Glad to hear that you resolved the issue and thanks for sharing your solution.



On Tuesday, October 31, 2017 at 5:19:49 PM UTC-4, Jörg Hartgen wrote:
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.

Am Dienstag, 31. Oktober 2017 03:03:30 UTC+1 schrieb Kamran (Google Cloud Support):

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





On Monday, October 30, 2017 at 5:58:52 PM UTC-4, Jörg Hartgen wrote:
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




--
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/4b3a1ab0-253e-4b66-aa09-009a54463c1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment