Erik Johnsson
Erik Johnsson

Reputation: 131

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

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?

Upvotes: 8

Views: 20550

Answers (2)

Bernard Esterhuyse
Bernard Esterhuyse

Reputation: 406

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.

Upvotes: 2

Zeehad
Zeehad

Reputation: 1102

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.

Upvotes: 8

Related Questions