I am trying to manage my SQL Server instance on Cloud SQL (GCP) with SQL Server Management Studio (SSMS).
I followed the steps in the Google Cloud documentation (here).
I followed steps 1-5 (condensed version below):
gcloud init
gcloud auth login
(P.S. I'm Owner on Project level)cloud_sql_proxy.exe
)./cloud_sql_proxy -instances=<INSTANCE_CONNECTION_NAME>=tcp:1433
(obviously replacing the <INSTANCE_CONNECTION_NAME>
portion with my instance name.At this point, everything seems to be working:
Listening on 127.0.0.1:1433 for <INSTANCE_CONNECTION_NAME>
Ready for new connections
New connection for <INSTANCE_CONNECTION_NAME>
New connection for <INSTANCE_CONNECTION_NAME>
Now following the instructions here, I attempt to connect to the database instance using SSMS (127.0.0.1
, SQL Server Authentication, sqlserver
, my super awesome password), Connect.
I now get the following error messages in the Cloud SDK window:
couldn't connect to <INSTANCE_CONNECTION_NAME>: dial tcp <PRIVATE_IP>:<PORT>: 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.
Throttline refreshCfg(<INSTANCE_CONNECTION_NAME>: it was only called XXXs ago
(and it repeats a few times)
In SSMS I get the following prompt:
How do I fix this issue and properly connect to my database instance?
When setting the Connectivity settings for the SQL Server instance, I changed it to Private IP
and unchecked the Public IP
setting. Re-enabling the Public IP
setting allowed me to establish a connection:
External applications can still connect to the instance through the Cloud SQL Proxy
This indirectly indicates to me that Cloud SQL Proxy needs the Public IP
option to be enabled in order to establish a connection.