I'm using MySQL v8.0.35 with django and python. A website is used to access the database with both the website and database hosted on AWS. When the website tries to access the database in any way, it throws this error:
OperationalError: (1045, "Access denied for user '<user>'@'*****' (using password: NO)")
The main issue is that I do not understand why password is not being used by the website despite it being included with the database configuration in my django settings.py file.
To me this is weird because while ssh'ed into the website's instance am able to run this command:
mysqladmin -h <endpoint> -u <user> -p version
is the same from above and when I am prompted to input my password, It executes perfectly.
I am also able to log into the database running this command while ssh'ed:
mysql -h <endpoint> -u <user> -p
At which point I input the same password and am let in. When I check my user's permissions, it shows this
[
In the settings file django is using to grab any database info, this is what I have:
DATABASES={
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'zombeewatch', # Or path to database file if using sqlite3.
'USER': '<user>', # Not used with sqlite3.
'PASSWORD': '<password>', # Not used with sqlite3.
'HOST': '<endpoint>', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '3306', # Set to empty string for default. Not used with sqlite3.
}
}
I am also able to use python manage.py
without any issues as well so the program seems to be able to grab the database, username, and password from my settings file just fine.
To be honest, I have no clue where to go from here. I think the main issue hinges on why the the website is trying to log into the database without a password when one is provided. I know there are a couple questions with this same error, but the context behind them seems to be very different. If I can provide anymore info, please let me know!
**Note that I have confirmed that the password I am using in the file is the correct one. At the very least, it is the same one I am copying and pasting when prompted for a password for the mysql and mysqladmin commands.