1

I have create a cloud sql instance as shown below -

Cloud SQL instance settings.

I have also allowed all network (0.0.0.0/0) under authorised network. But when I try to connect it using gcloud sql connect <ip address> -u <username> I get this error -

ERROR: (gcloud.sql.connect) HTTPError 400: Invalid request: instance name (34.69.175.233).

When I run the same command like this gcloud sql connect <ip address> -u <username> --log-http for the log I get this -

{ "error": { "code": 400, "message": "Invalid request: instance name (34.69.175.233).", "errors": [ { "message": "Invalid request: instance name (34.69.175.233).", "domain": "global", "reason": "invalid" } ] } } 

I am not able to identify what exactly is the problem.

6
  • You should be able to connect directly to that instance (on that IP) using a regular MySQL client. gcloud sql connect ... requires the instance name (not IP) and uses the SQL proxy to connect to the instance. Commented Jun 12, 2020 at 17:03
  • not able to connect after using instance name via cloud shell Commented Jun 12, 2020 at 17:11
  • Aha! Hmmm :-( Let me repro and I'll report back Commented Jun 12, 2020 at 17:49
  • I see you're using SQL Server (not MySQL|Postgres) so my previous suggestion to use a MySQL client is incorrect but, I'm reviewing the SQL Server docs. Commented Jun 12, 2020 at 17:52
  • 1
    I think you cannot use gcloud sql connect with SQL Server Commented Jun 12, 2020 at 17:54

2 Answers 2

1

Note that, gcloud sql connect command is not supported for Cloud SQL Server at this time and you may instead connect via a local client, or the proxy. I have send a feedback to the Cloud SQL Documentation team to clarify that this command is not applicable for Cloud SQL Server in the gcloud documentation until the gcloud command gets implemented.

Sign up to request clarification or add additional context in comments.

Comments

0

you can try with "cloud_sql_proxy -instances=[connection-name]=tcp:0.0.0.0:[port]"

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.