Wednesday, January 8, 2020

[google-cloud-sql-discuss] couldn't connect to "connection-string": dial tcp X.X.X.X:3307: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to

I'm trying to use the cloud SQL proxy to connect to a MySQL instance that only has a private IP. The proxy starts just fine using this command:

cloud_sql_proxy -instances=connection-string=tcp:3310

However, when I try to connect with mysql in a different window, I can enter a password, but after a few seconds, the connection drops, and the proxy shows this message:

couldn't connect to "connection-string": dial tcp X.X.X.X:3307: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

When I look at the logs in GCP, the incoming connection is shown and seems to be allowed (somewhere in the log json, it says granted: true). However, it appears the proxy either doesn't receive the response from the SQL instance, or is unable to parse it.

I tried opening up all possible firewall rules, but that changes nothing. I also tried all suggestions mentioned here: https://github.com/GoogleCloudPlatform/cloudsql-proxy/issues/164

Does anyone have any idea what's going on? Google documentation is really lacking here.

--
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/e90488dc-f6da-4e42-969c-98aa8cfcde93%40googlegroups.com.

No comments:

Post a Comment