One thing that stands out to me is that the exception message indicates that it 
is looking for “detectiondata_dev” instead of “detectiondata-dev”.
Also, did you run migrations?

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of acka...@ucsd.edu
Sent: Monday, July 9, 2018 5:01 PM
To: Django users
Subject: Configuring Remote Existing DB through RDS

Hi everyone,

I'm having trouble connecting an existing MySQL database through the 
settings.py file in my project and was wondering if anyone has ever experienced 
similar issues. The database section of settings.py appears as follows:

DATABASES = {
    'default': {
        'NAME': 'detectiondata-dev',
        'ENGINE': 'django.db.backends.mysql',
        'USER': 'user_with_admin_privileges',
        'PASSWORD': 'admin_password',
        'HOST': 'host_name_from_rds',
        'PORT': '3306',
    },
}

where 'user_with_admin_privileges' is an obscured (but working) admin username 
- same thing with the password and hostname. Port 3306 is allowed through my 
firewall, inbound/outbound.

The database is a running MySQL instance on an AWS account. Interestingly 
enough, my laptop (running environment is Windows Subsystem for Linux) seems to 
be able to recognize/connect to the database - I'm successfully able to view 
the database using the mysql command in bash:

msql -u 'user_with_admin_privileges' -p -h 'host_name_from_rds'

... where I then enter 'admin_password' and can successfully interact with the 
remote DB. Additionally, commands such as telnet and nc can connect to the 
specified host. I also tried connecting another public database and encountered 
similar errors, even though I could otherwise view the database remotely.

When trying to migrate the existing database, or even run the server, Django 
freaks out (see attached error files). I'm executing from within a virtualenv 
using python 3, not sure what's wrong. Searched all over the web and through 
this group and haven't found a similar problem, so I thought I'd post as a last 
resort. Thanks!
--
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+unsubscr...@googlegroups.com<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-users@googlegroups.com<mailto:django-users@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/cf5a90f0-b6f5-404e-9649-459d3db9159c%40googlegroups.com<https://groups.google.com/d/msgid/django-users/cf5a90f0-b6f5-404e-9649-459d3db9159c%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/4a0c7b868ef94a40a132b4c192077edc%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.

Reply via email to