Asif
Asif

Reputation: 1648

Python manage.py migrate error when changing database from sqlite to mysql

I just started learning django. I change the following settings from setting.py because I want to use mysql not sqlite:

DATABASES = {
    'default' : {
        'ENGINE' : 'django.db.backend.mysql',
        'NAME' : 'newprj',
        'USER' : 'root',
        'PASSWORD' : 'abcd',
        'HOST' : 'localhost',
        'PORT' : ''
    }
}

then when I try this code python manage.py migrate on cmd. It throws an big error, I can't understand what is the problem, please help me solve it. This is the error: enter image description here

Upvotes: 0

Views: 216

Answers (1)

ans2human
ans2human

Reputation: 2357

You missed the s in django.db.backends.mysql

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',    #<---- You missed the s in backends
        'NAME': 'myproject',
        'USER': 'myprojectuser',
        'PASSWORD': 'password',
        'HOST': 'localhost',
        'PORT': '',
    }
}

Upvotes: 1

Related Questions