By alexandrer
Hi, I am kind of a beginner so I can be doing something very wrong, but this is my situation: I was trying to connect my Django application to my Digital ocean’s MySQL database, with the following configurations:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': '<name>',
'USER': 'doadmin',
'PASSWORD': '<pass>',
'HOST': '<host>',
'PORT': '25060',
'OPTIONS': {
'ssl': {
'ca': <ca_certificate_downloaded_from_managing_page>,
'cert': None,
'key': None,
},
},
}
}
These specifications were copied from the digital ocean cluster managing webpage, so no typos. I’ve downloaded the CA certificate and provided everything that was asked. With DBeaver everything seems to work fine. I’ve also tried to update mysql client but nothing works. This is the error that pops on the console:
(...)
File "C:\Users\Alexandre\AppData\Local\Programs\Python\Python38-32\lib\site-packages\MySQLdb\connections.py", line 179, in __init__
super(Connection, self).__init__(*args, **kwargs2)
django.db.utils.OperationalError: (2026, 'SSL connection error: unknown error number')
I’ve ran out of ideas.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I just created a new Django project using python 3 and configured the Database backend the same way yo did except for the SSL options, I left them to use defaults and it worked without any issues.
Please could you try again using my configuration? Python 3 and no SSL options.
Hope this helps
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.