django.db.utils.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: YES)")
You need to make changes in project settings.py.
Provide USER and PASSWORD for your database
If your database isn't mysql change ENGINE
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'myproject',
'USER': 'root',
'PASSWORD': 'rootpassword',
'HOST': 'localhost',
'PORT': '',
}
}
4
10
mysql> grant all privileges on *.* to root@localhost identified by 'password' with grant option;
Thank you!
10
0
4.11
9
create user 'django'@'localhost' identified by 'django-user-password';
grant usage on *.* to 'django'@'localhost';
grant all privileges on django-database-1.* to 'django'@'localhost';
Thank you!
9
0
Are there any code examples left?
New code examples in category Other