Google Cloud SQL - ERROR 2003 (HY000): Can't connect to MySQL

I am trying to connect my Google Cloud SQL using the command line.
I can successfully connect when at home and I set a static IP address. However, I have to be on the road the next few days and I can't be at home. I am hoping to connect to mysql and make changes as needed on the server through the hotspot on my phone, but I would be happy with any type of internet connection working. How can I connect to my Google Cloud SQL even though I keep getting error as,

ERROR 2003 (HY000): Can't connect to MySQL on server ...

  1. I tried creating a Google Compute Engine VM instance and setting a static IP address and connection to mysql through that, but it doesn't work.
  2. I make sure everytime to authorize the appropriate IP address, I am connecting from.

I am scratching my head and cannot figure out why it won't let me connect but at home even though I authorize all other IP address I have ever tried to connect from.


Solution 1:

So for whatever reason, I was able to connect if I requested an IPv4 address (costs $0.01 an hour) and used that to connect instead of the free IPv6 address, then I could connect from anywhere. Otherwise I can only connect to my Cloud SQL when it is using the free IPv6 address at home. Check out the screen shot below to see which button to press on Cloud SQL Page > Access Control > IP addresses in order to request an IPv4 address and be able to connect with that IP address.

enter image description here