Tuesday, February 11, 2020

[google-cloud-sql-discuss] Re: Can't connect to Cloud SQL from Compute Engine

Hello Ram,


According to MySQL documentation [1], this error is thrown when a network connection has been refused. If you are using a private IP, then make sure your Compute Engine instance is in the same region as the Cloud SQL instance and on the network configured for a private connection. You can follow these guidelines [2] for private IP connection, or these steps [3] for public IP. If you have enabled SSL on the instance, here is how to set this up for proper connections [4].


[1] https://dev.mysql.com/doc/refman/5.7/en/can-not-connect-to-server.html

[2] https://cloud.google.com/sql/docs/mysql/connect-compute-engine#connecting_using_private_ip 

[3] https://cloud.google.com/sql/docs/mysql/connect-compute-engine#gce-connect-ip 

[4] https://cloud.google.com/sql/docs/mysql/connect-admin-ip#connect-ssl


On Monday, February 10, 2020 at 9:10:07 AM UTC-5, Ram Gupta wrote:
Hi,

I am receiving "ERROR 2003 (HY000): Can't connect to MySQL server on " on connecting to Cloud SQL from Compute Engine. Both are in the same project. I have added compute engine IP Address to the allowed connections.

--
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/45f3df06-8d13-4169-83aa-0b6d45da577c%40googlegroups.com.

No comments:

Post a Comment