Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Unknown MySQL server host in Django

I have a MySQL RDS instance with Amazon's AWS as the database for my Django app. When I do run the command python manage.py runserver 192.68.1.103:8000, I get this error:

(2005, "Unknown MySQL server host 'myapp.us-east-1.rds.amazonaws.com' (2)")

I can connect to the database using MySQL Workbench though. When I run the app through Apache, there are no problems either. I tried restarting the RDS instance but that didn't resolve the issue.

What is going on here and how do I fix it?

like image 940
Di Zou Avatar asked Jul 02 '13 04:07

Di Zou


1 Answers

I experienced this on my local machine in some long running terminal (iTerm2) window. I'm not sure what it was but Django didn't resolve my db server name, maybe because of some DNS issues.

So running ./manage.py runserver in another terminal solved the problem

like image 138
DDS Avatar answered Sep 25 '22 14:09

DDS