[Solved] django.db.utils.OperationalError: (2026, ‘SSL connection error: unknown error number’)

Sumedha Gn
Feb 25, 2022

I had this issue when running ‘python manage.py makemigrations’ from my Django project to a remote MySQL server. I’m using Django 3.1.7 and MySQL 8.0.

The below solution worked for me:

  1. Install PyMySQL
pip install PyMySQL

2. In __init__.py (under the same directory as settings.py), add the following:

import pymysqlpymysql.install_as_MySQLdb()

Hope this helps!

--

--

Sumedha Gn

Documenting errors I’ve faced so you can save time trying to resolve them, feel free to let me know how I can improve too!