I was using "mysql.connector.django" with "mysql-connector-python" for the database backend. This configuration led to the error. Here's what I had in my settings.py:
DATABASES = {
'default': {
'ENGINE': 'mysql.connector.django',
'NAME': 'your_db_name',
'USER': 'your_db_user',
'PASSWORD': 'your_db_password',
'HOST': 'your_db_host',
'PORT': 'your_db_port',
}
}
To fix the issue, I switched to "django.db.backends.mysql" with "mysqlclient" as the database backend. Here is the updated configuration that resolved the error:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'your_db_name',
'USER': 'your_db_user',
'PASSWORD': 'your_db_password',
'HOST': 'your_db_host',
'PORT': 'your_db_port',
}
}
After making this change, running python manage.py migrate worked without any errors.