How to use MySQL Workbench to set up connection and connect Google cloud sql
Asked Answered
D

2

8

I follow this tutorial https://cloud.google.com/sql/docs/admin-tools

but it is very abstract.

I am unable to set up a new connection in MYSQL workbench correctly. It always pops up "failed to connect MySQL at 2001:4860:4864:1:c88e:be5b:bd5:6cf7:3306 with user root,10060"

My google cloud SQL IP address is 2001:4860:4864:1:c88e:be5b:bd5:6cf7,port is 3306 username :root. (I set root ) password : admin, each time.

I have put my computer's ipv4 address to Cloud SQL allowed network (Authorization).

Question I guessed:

  1. Actually I am not sure how to fill 'port', in local , I know it is 3306 in general. I am not sure if the port is 3306 as well when the instance address is ipv6 format.

  2. Is it possible I made mistake when set up my IP address in Cloud SQL authorization? I used laptop in my home internet. First I just searched my ip address using google 'my ip address', 108.15.38.144', then fill it in the "allowed network" in Cloud SQL.

  3. Is it possible I made mistake when I set up user 'root'? I just type user name and password in user setting of access control in Cloud Sql I didn't change clienthost's default value :% when I set up user,

Connection error image:

Connection error image

Any ideas on what I could be doing wrong here?

Digitalis answered 26/4, 2015 at 4:47 Comment(6)
The port for connecting either over IPv4 or IPv6 is 3306. You should be able to use the IPv6 address in the "MySQL Hostname" field in the MySQL Workbench (I'm looking at this screenshot).Matos
@RazvanMusaloiu-E.Thank you very much for reply. I attached the image there. I saw you used standard TCP/IP over ssh, do I have to use 'over ssh' connection? In the other hand, I think the username and password should match with Database instance users in cloud sql, right? the default user in cloud sql has 'root','admin',':', I don't know how difference between them. I just left 'root' in cloud sql.Is it possible my setting of 'user' is not correct? BTW, I closed firewall. ThanksDigitalis
I found my problem is solved when I applied a ipv4 address for my cloud sql. I am not enable to connect cloud sql by using its ipv6 address @RazvanMusaloiu-EDigitalis
Can you make sure you added to the list of authorized networks the IPv6 from where you connecting?Matos
the list of authorized networks I added is my pc's ipv4 public address. Oh, do you mean I should add my ipv6 address if I want to set up a new connection with cloud sql's ipv6 address?Thanks @Razvan Musaloiu-E.Digitalis
Yes, that's exactly what I mean. :-)Matos
A
7

Connectivity from MySQL Workbench to Google Cloud SQL is possible by following instructions here. Make sure access for external applications is configured properly.

Also, if your ISP does not support IPv6 connectivity, then you will not be able to use the IPv6 address provided to facilitate connections. In this case, you will have to request an IPv4 address for your Cloud SQL instance.

Aversion answered 21/3, 2016 at 21:49 Comment(0)
A
2

I have been connecting my Google Cloud MySQL database to MySQL workbench for a while without problems. Today I tried to connect and got a connection error. After some investigation I found that my external IP address has changed, and I had to update the authorised IP address in the Google Cloud console:

enter image description here

It makes sense, but this is quite annoying. Seems my ISP changes the IP addresses periodically.

Adaadabel answered 29/4, 2020 at 7:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.