There are similar questions out there to this one, but I am not finding anything that is solving my issue.
I am working on a django project and made a database change and want to migrate the database change to production. So I run
python manage.py migrate
But I receive this error
OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: NO)")
From what I understand I must not have permission to run the migration, but I did try
grant all privileges on *.* to root@localhost identified by 'password' with grant option;
and different combinations thereof, but to no avail.
In my local_settings.py I have
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'USER': 'root',
'PASSWORD': 'password',
'HOST': '127.0.0.1',
'NAME': 'stratinvnet',
},
}
I've tried to change 127.0.0.1
to localhost
and that seems to make no difference. I have also tried to remove the password from the DATABASES
object.
For what it's worth, here is my GRANTS
table in mysql.
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*5FE8B16533FAE91D61522C9A6811F3F709147255' WITH GRANT OPTION |
| GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
and here is the user table.
user | host | password |
+------------+-----------+-------------------------------------------+
| root | localhost | *5FE8B16533FAE91D61522C9A6811F3F709147255 |
| root | 127.0.0.1 | |
| root | ::1 | |
| | localhost | |
| root | % | *944B67F866A66B9DDD96024A97EBFDC886FC41F6 |
| phpmyadmin | localhost | *5FE8B16533FAE91D61522C9A6811F3F709147255 |