0

Can I use mysql database from my personal web server instead of heroku's database?

in django settings I have this for databses:

DATABASES={

'default': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': 'name',
    'USER': 'user',
    'PASSWORD': 'pass',
    'HOST': 'x.x.x.x',   
    'PORT': '3306',
}
}

what should be my settings.py databases part? or do I need anything more to do?

2
  • Why, what's the problem with Heroku's database? Commented Sep 19, 2017 at 7:44
  • 1
    This sounds like a bad idea. Apart from the latency as iklnac points out, you are losing most of the benefits of getting Heroku to manage your infrastructure in the first place. After all, if you manage your own MySQL, why not also manage your own hosting and not bother with Heroku at all? Commented Sep 19, 2017 at 8:48

1 Answer 1

1

Yes, you can use your personal MySQL server but there are big drawbacks in following as servers are not on the same network so you are introducing latency in each query.

To do following things that are necessary is that Heroku node can access your MySQL server and that your MySQL user can connect to your database from the node.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.