amazon-elastic-beanstalk amazon-web-services django mysql python

Django + MySQL on Elastic Beanstalk – Error When Querying MySQL

I’m getting an error when I query MySQL on my Django app hosted on elastic beanstalk. The error says:

OperationalError at /admin/login
(1045, “Access denied for user ‘adminDB’@’’ (using password: YES)”)

Here is my .config file:

command: "source /opt/python/run/venv/bin/activate && python migrate --noinput"
leader_only: true
DJANGO_SETTINGS_MODULE: "mysite.settings"
"PYTHONPATH": "/opt/python/current/app/mysite:$PYTHONPATH"
WSGIPath: mysite/
NumProcesses: 3
NumThreads: 20
"/static/": "www/static/"

Here is my the databases section on

'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': os.environ['RDS_DB_NAME'],
'USER': os.environ['RDS_USERNAME'],
'PASSWORD': os.environ['RDS_PASSWORD'],
'HOST': os.environ['RDS_HOSTNAME'],
'PORT': os.environ['RDS_PORT'],

I created the eb environment through the eb create command and then proceeded to create an RDS database on the eb console on their website. Is there anything else I need to do to connect Django to MySQL? Something to do with security groups or something?