[英]database host in ipv6
I am configuring my django app that is to run from a VM instance in the google compute engine. 我正在配置要从google计算引擎中的VM实例运行的django应用。 The database exists in a google cloud sql instance whose ipv6 address I have.
该数据库存在于我拥有其ipv6地址的google cloud sql实例中。 How can I mention this ipv6 address as the database's host in my app's settings.py?
如何在我的应用的settings.py中提到此ipv6地址作为数据库的主机?
The following doesn't work; 以下内容不起作用;
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'name',
'USER': 'username',
'PASSWORD': 'password',
'HOST': '2001:4860:4864:1:a454:abcd:abcd:abcd',
'PORT': ''
}
}
I end up with an error telling : 我最终得到一个错误提示:
django.db.utils.OperationalError: (2003, "Can't connect to MySQL server on '2001:4860:4864:1:a454:abcd:abcd:abcd' (101)")
Unfortunately Managed VM do not support IPv6. 不幸的是,受管虚拟机不支持IPv6。 You will need to use the CloudSQL IPv4 address.
您将需要使用CloudSQL IPv4地址。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.