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

3,239 views
Skip to first unread message

Wouter Florijn

unread,
Jan 8, 2020, 11:07:39 AM1/8/20
to Google Cloud SQL discuss
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.

George (Cloud Platform Support)

unread,
Jan 8, 2020, 12:58:57 PM1/8/20
to google-cloud...@googlegroups.com
Hello Wouter, 

You need to implement a VPC peering connection between your VPC network and the Google services VPC network where your Cloud SQL instance resides. There are other conditions for successful connectivity, all described on the "Private IP" documentation page. How do your settings compare with the requirements on this page? You may also check requirements on About the Cloud SQL Proxy

Barry Tarlton

unread,
Jan 12, 2020, 1:21:27 PM1/12/20
to google-cloud...@googlegroups.com
Thank you for the update. I will begin configuring them today. I appreciate you help with this issue. 


On Wed, Jan 8, 2020 at 12:59 PM 'George (Cloud Platform Support)' via Google Cloud SQL discuss <google-cloud...@googlegroups.com> wrote:
Hello Wouter, 

You need to implemented a VPC peering connection between your VPC network and the Google services VPC network where your Cloud SQL instance resides. There are other conditions for successful connectivity, all described on the "Private IP" documentation page. How do your settings compare with the requirements on this page? You may also check requirements on About the Cloud SQL Proxy

--
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-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/6999b7aa-8e40-4afa-847c-fee2135ca7dc%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages