I have set up an Amazon Relational Database Service (RDS) with a MySQL database and I'm trying to connect it with my django application but I'm getting the above error. My database settings in settings.py are as follows:
DATABASES = {
'default': {
'ENGINE': config('db_engine'),
'NAME': config('db_name'),
'USER': config('db_user'),
'PASSWORD': config('db_password'),
'HOST': config('db_host'),
'PORT': config('db_port')
}
}
and my database environment variables are as follows:
db_engine=django.db.backends.mysql
db_name=stagingdatabase
db_user=staginguser
db_password=stagingpassword
db_host=somestagingname.somestagingid.us-east-2.rds.amazonaws.com
db_port=3306
I know the port is correct, which is the solution for most cases having these types of errors. All other variables are correct as well.
I can't ping somestagingname.somestagingid.us-east-2.rds.amazonaws.com even though its status is available, so there must be an issue in how I setup the RDS:
