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

独自空忆成欢 提交于 2019-12-10 19:17:55

问题


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.


回答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.



来源:https://stackoverflow.com/questions/29874570/google-cloud-sql-error-2003-hy000-cant-connect-to-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!