0

I have created new project in django and write mysql connection in it's settings file like :

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'optdb',
        'User': 'root',
        'Password':'975',
        'Host':'127.0.0.1',
        'Port':'8080',
    }
}

Now i write command : python manage.py syncdb and that generates following error:

enter image description here How to solve this error mentioned above? Note: I have currently one user in my MYSQL WAMP SERVER that is root with host 127.0.0.1.

2 Answers 2

1

All of those keys should be in capitals.

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'optdb',
        'USER': 'root',
        'PASSWORD':'975',
        'HOST':'127.0.0.1',
        'PORT':'8080',
    }
}
Sign up to request clarification or add additional context in comments.

Comments

1
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'optdb',
        'USER': 'root',
        'PASSWORD':'975',
        'HOST':'127.0.0.1',
        'PORT':'8080',
    }
}

It's case sensitive...

Also, are you sure your mysql server is at port 8080? That's unusual. If unsure, just leave out that line and default mysql port will be used. See How can I connect to MySQL on a WAMP server?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.