Google Cloud SQL-错误2003(HY000):无法连接到MySQL [英] Google Cloud SQL - ERROR 2003 (HY000): Can't connect to MySQL

查看:117
本文介绍了Google Cloud SQL-错误2003(HY000):无法连接到MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用命令行连接我的Google Cloud SQL.
我在家时可以成功连接并且设置了静态IP地址.但是,接下来的几天我必须上路,而且我不能在家.我希望连接到mysql并通过手机上的hotspot根据需要在服务器上进行更改,但是我对任何类型的Internet连接都能正常工作感到满意.

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):无法连接到服务器上的MySQL ...

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

  1. 我尝试创建一个Google Compute Engine VM实例,并通过该实例设置一个静态IP地址和与mysql的连接,但是它不起作用.
  2. 我确保每次都从我的连接中授权适当的IP地址.
  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.

我挠头,不知道为什么即使我授权了曾经尝试连接的所有其他IP地址,它也不允许我在家里连接,

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.

推荐答案

因此,无论出于何种原因,如果我请求一个IPv4地址(每小时的费用为0.01美元)并使用该地址代替免费的IPv6地址,就可以进行连接,那么我可以从任何地方连接.否则,只有当Cloud SQL在家里使用免费的IPv6地址时,我才能连接到它.请查看下面的屏幕快照,以查看在Cloud SQL页面>访问控制> IP地址上按下哪个按钮,以请求IPv4地址并能够使用该IP地址进行连接.

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.

这篇关于Google Cloud SQL-错误2003(HY000):无法连接到MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆