ovz1nq
Last Updated: February 25, 2016
·
5.196K
· dperrymorrow
37b092a324da25d53fd63d780692b174

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.

Say Thanks
Respond

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
37b092a324da25d53fd63d780692b174

glad you found it useful,

over 1 year ago ·
16172
2a3d88d951fd2a6b3dfd10064df92441

thanks!

over 1 year ago ·
23228
B1f557a37ffc97d9387c0962160562c5

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

over 1 year ago ·
23229
37b092a324da25d53fd63d780692b174

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 ·