Edward Kim
Edward Kim

Reputation: 47

solution for django.db.utils.OperationalError

I am a student (using Ubuntu) who has recently started with studying database and django.

I have been trying to open one of my team member's django web, but when I type

python manage.py runserver

it shows me a message at the end saying

django.db.utils.OperationalError: (1698, "Access denied for user 'root'@'localhost'") 

Is there any good solution for this problem? I have been searching for similar problems, but still haven't found a good solution yet. Please let me know if there is any other additional information needed. Thank you.

Upvotes: 0

Views: 19031

Answers (1)

Pankaj
Pankaj

Reputation: 939

Have you setup properly the config file? If yes, please check user privilege for the assigned db.

Here is the one way you can create db and user and grant the permission.

CREATE DATABASE test_db;
CREATE USER test_user identified by 'test_password';
GRANT ALL on test_db.* to 'test_user'@'%';
FLUSH PRIVILEGES;

Many developer experience the same issue. Please check the other thread which many have explained in details the same issue.

Using MySQL with Django - Access denied for user '@'localhost

django.db.utils.OperationalError: (1045, Access denied for user '<user>'@'localhost'

Upvotes: 2

Related Questions