user2757111
user2757111

Reputation:

How to configure Django to Use mysql

I'm totally new to django, I've just passed the tutorials, I try to use it with mysql, with setting my backend in settings file and put mysql user and password, But did not succeed. What else should I do?

Upvotes: 2

Views: 69

Answers (1)

alecxe
alecxe

Reputation: 474171

You need to configure DATABASES setting in settings.py.

Here's an example configuration:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'mydb',
        'USER': 'myuser',
        'PASSWORD': 'mypassword',
        'HOST': '127.0.0.1',
        'PORT': '3306'
    }
}

Upvotes: 1

Related Questions