背景:使用docker部署,因数据库IP更换(10.10.xx.142-->10.10.xx.189)。更换后,出现不知名数据库IP 172.18.0.3。
软件环境:
cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
setting.py配置文件:
该项目本身的mysql数据库地址
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'archery',
'USER': 'archery',
'PASSWORD': 'xxxxxx',
'HOST': '10.10.xx.189',
'PORT': '3306',
'OPTIONS': {
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
'charset': 'utf8mb4'
},
'TEST': {
'NAME': 'test_archery',
'CHARSET': 'utf8mb4',
},
}
}
报错信息:
[2020-11-30 16:10:04,820][MainThread:139816026425152][task_id:django-q][cluster.py:560][ERROR]- (1130, "Host '172.18.0.3' is not allowed to connect to this MySQL server")
[2020-11-30 16:10:34,913][MainThread:139816026425152][task_id:django-q][cluster.py:560][ERROR]- (1130, "Host '172.18.0.3' is not allowed to connect to this MySQL server")
[2020-11-30 16:11:05,009][MainThread:139816026425152][task_id:django-q][cluster.py:560][ERROR]- (1130, "Host '172.18.0.3' is not allowed to connect to this MySQL server")
[2020-11-30 16:11:35,104][MainThread:139816026425152][task_id:django-q][cluster.py:560][ERROR]- (1130, "Host '172.18.0.3' is not allowed to connect to this MySQL server")
[2020-11-30 16:12:05,199][MainThread:139816026425152][task_id:django-q][cluster.py:560][ERROR]- (1130, "Host '172.18.0.3' is not allowed to connect to this MySQL server")
[2020-11-30 16:12:35,291][MainThread:139816026425152][task_id:django-q][cluster.py:560][ERROR]- (1130, "Host '172.18.0.3' is not allowed to connect to this MySQL server")
[2020-11-30 16:13:05,389][MainThread:139816026425152][task_id:django-q][cluster.py:560][ERROR]- (1130, "Host '172.18.0.3' is not allowed to connect to this MySQL server")
[2020-11-30 16:13:35,483][MainThread:139816026425152][task_id:django-q][cluster.py:560][ERROR]- (1130, "Host '172.18.0.3' is not allowed to connect to this MySQL server")
[2020-11-30 16:14:05,579][MainThread:139816026425152][task_id:django-q][cluster.py:560][ERROR]- (1130, "Host '172.18.0.3' is not allowed to connect to this MySQL server")
尝试手段:
重新安装以及清除所有文件下载,甚至从v1.8.0更换成v1.7.13重装。都相同的情况。