问题描述
我从Python / Django应用程序连接到我的AWS RDS数据库有一些麻烦。我试图在本地运行我的应用程序时收到此错误:
I'm having some trouble connecting to my AWS RDS Database from my Python/Django application. I'm getting this error when trying to run my application locally:
django.db.utils.OperationalError: (2026, 'SSL connection error: error:00000001:lib(0):func(0):reason(1)')
I couldn't find any answers online as I am not trying to connect via SSL.
我的数据库设置位于 settings.py
很简单:
My Database settings in settings.py
is straightforward:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': '<my db name>',
'USER': '<my username>',
'PASSWORD': '<my password>',
'HOST': '<my aws host>',
'PORT': '<my port>',
}
}
我尝试通过终端访问MySQL RDS时遇到了同样的错误,但是通过将 - skip-ssl
添加到comm的结尾来解决该错误和。我已经环顾四周,但还没有找到一种方法来实现与Django应用程序相同的修复。
I was getting the same error trying to access the MySQL RDS via terminal, but was able to resolve that error by adding --skip-ssl
to the end of the command. I've looked around but haven't yet found a way to implement that same fix with my Django application.
这是我第一次使用Python,Django和AWS (并且还发布一个堆栈溢出的问题),所以如果我的术语关闭,我提前道歉。提前感谢您提供的任何帮助。
This is my first time working with Python, Django and AWS (and also posting a question on stack overflow) so I apologize in advance if my terminology is off. Thank you in advance for any help you can provide.
推荐答案
你尝试过
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': '<my db name>',
'USER': '<my username>',
'PASSWORD': '<my password>',
'HOST': '<my aws host>',
'PORT': '<my port>',
'OPTIONS': {
'skip-ssl',
},
}
}
这篇关于Django AWS RDS MySQL错误:(2026,'SSL连接错误:错误:00000001:lib(0):func(0):reason(1)')的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!