How to deploy a local MySQL database in Heroku

I am new to using Heroku and I have a Ruby / Sinatra application in which I plan to use the MySQL database as the main data store.

However, I do not want to write the results directly to the Heroku database. Instead, I want to write the results to a local database, and then I can easily deploy / update / copy my local database to the "production" Heroku database.

How to do it?

Thank.

+42
mysql heroku
Mar 03 '13 at 21:43
source share
1 answer

Firstly, Heroku originally uses postgres. Life will be easier for you if you use it locally.

You can import / export postgres dump files from heroku as described here: https://devcenter.heroku.com/articles/heroku-postgres-import-export

If you really want to use mysql, you have two ways.

1) Run mysql locally, but convert to postgres when porting to Heroku using gem mysql2psql, as described here: https://devcenter.heroku.com/articles/heroku-mysql p>

2) Use the mysql addon, e.g. https://addons.heroku.com/cleardb

However, my recommendation would be to use postgres to the end, as it is baked into Heroku and you will work with the standard ways of using Heroku, not against them.

Postgres is also very good!

+42
Mar 03 '13 at 21:56
source share



All Articles