Getting django.db.utils.OperationalError: (2005, "Unknown MySQL server host error with AWS

1,399 views
Skip to first unread message

prateek gupta

unread,
Jun 15, 2018, 12:46:53 PM6/15/18
to Django users
Hi All,

I am trying to connect with AWS and when I run the server I get following error-
django.db.utils.OperationalError: (2005, "Unknown MySQL server host 'psdbuat.chmnxeoa2hhd.ap-southeast-1.rds.amazonaws.com' (0)")

I checked the connection in mysql workbench and details are fine.
My settings.py is as below-
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'myschema',
'USER': 'admin',
'PASSWORD': 'aadmin',
'HOST': 'psdbuat.chmnxeoa2hhd.ap-southeast-1.rds.amazonaws.com',
'PORT': '3306',
}
}

I googled and found it is issue with AWS but did not find any solution.
Can anyone please share teh solution for it?

Jason

unread,
Jun 15, 2018, 1:11:42 PM6/15/18
to Django users
have you checked your security settings in the aws console to make sure the port is open?

Andréas Kühne

unread,
Jun 15, 2018, 2:25:10 PM6/15/18
to django...@googlegroups.com
As Jason stated you probably have an issue with security groups. Make sure that your EC2 instance is in a security group that can access the mysql server. Otherwise you won't be able to connect. And the error you have is what you get when the security groups aren't correct.

See here:

Regards,

Andréas

2018-06-15 15:11 GMT+02:00 Jason <jjohn...@gmail.com>:
have you checked your security settings in the aws console to make sure the port is open?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ff00ed62-d489-42b7-90de-a835e4f57da2%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

prateek gupta

unread,
Jun 15, 2018, 2:33:24 PM6/15/18
to Django users
Thanks Json, I will check this.

prateek gupta

unread,
Jun 15, 2018, 2:33:43 PM6/15/18
to Django users
Thanks, I will verify.


On Friday, June 15, 2018 at 7:55:10 PM UTC+5:30, Andréas Kühne wrote:
As Jason stated you probably have an issue with security groups. Make sure that your EC2 instance is in a security group that can access the mysql server. Otherwise you won't be able to connect. And the error you have is what you get when the security groups aren't correct.

See here:

Regards,

Andréas

2018-06-15 15:11 GMT+02:00 Jason <jjohn...@gmail.com>:
have you checked your security settings in the aws console to make sure the port is open?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
Reply all
Reply to author
Forward
0 new messages