How to connect to RDS from locally created django?

Viewed 23

I am trying to connect to Aurora on RDS from a local Django application.

Docker is used as the execution environment.

Publicly Accessible is allowed to connect to RDS from local.

I have confirmed that I can connect from local with mysql command, but not from on django.

Why can't I connect from Django?

Commands tried:

$ mysql -h xxxx.xxxx.ap-northeast-1.rds.amazonaws.com -u admin -p
mysql> 

This command allows you to get inside mysql.

The django database setup is as follows:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'xxxxxxxx',
        'USER': 'admin',
        'PASSWORD': 'xxxxxxx',
        'HOST': 'xxxxx.xxxxxxx.ap-northeast-1.rds.amazonaws.com',
        'PORT': '3306',
    }
}

Output error statement:

django.db.utils.OperationalError: (2002, "Can't connect to MySQL server on 'xxxxx.xxxxx.ap-northeast-1.rds.amazonaws.' (111)")
0 Answers
Related