ovz1nq
Last Updated: February 25, 2016
·
7.023K
· dperrymorrow

Using External Database with Heroku

Heroku is awsome as long as you dont need a large database or background jobs, then it gets expensive really quick.

Want to use an external database with heroku? It's pretty easy.

heroku config:add DATABASE_URL=mysql://user:pass@server:port/database_name

which is equivalent to...

[adapter]://[username]:[password]:[server_address]:[port]/[database_name]

this will setup your production database settings with the supplied information.

5 Responses
Add your response

8610

Was hunting for exactly this. Thanks for the information.
Yep, the 10K limit for a free database on Heroku is like just for testing purposes.

over 1 year ago ·
8612

glad you found it useful,

over 1 year ago ·
16172

thanks!

over 1 year ago ·
23228

Wait, does that mean that Heroku leaves the ports open to the public?!?

over 1 year ago ·
23229

no i think it would be the other way around, you would have to have your database open to the outside to let your heroku app reach it.

when i did this it was a clear db mysql add on to heroku.

over 1 year ago ·