Heroku and MySQL

Hi,

Whenever I deploy a Rails app using MySQL I get an application error. I even tried a hello-world app and I get the error even though everything was uploaded fine. It always says to look in my logs but there’s nothing there. Heroku says it should ‘just work’ with no explanation. Has anyone successfully done this and what basic tweaks did you have to make?

Thanks

AFAIK Heroku only runs PostgreSQL. I am not aware of any changes to that policy.

If you run MySQL on a different server (maybe one of the AWS RDB services or the like) then you just have to set up your database connection for production to use that host and skip the Heroku database layer altogether.

Walter

Or.. Heroku will convert sqlite3 databases during the push. I wouldn't know for sure; but from the OP I'd guess they don't do the same for MySQL

AFAIK Heroku only runs PostgreSQL. I am not aware of any changes to that policy.

Or.. Heroku will convert sqlite3 databases during the push.

Really? I thought they just ran the migrations against a new PostgreSQL database and that was that. I've never seen data migrate during a push to Heroku -- have you?

Walter

Hey! Don't try to confuse me with logic and facts :slight_smile:

You're right and I was confused. The Sqlite conversion is during a heroku db:pull Not during a mgiration.

Sorry.. still haven't had my 10th cup of coffee.

Yes, many times, and as long as you have everything the app needs properly specified in your Gemfile and no proprietary DB statements in your code, it should "just work".

Can you paste the log from a test deployment?

Ok, I misunderstood - I thought you could keep your mysql gem. I migrated to Postgres and made a few controller tweaks and it worked. Thanks for your help.

Just to be clear, for anyone else finding this thread -- you *don't* have to "migrate to Postgres" locally to use Heroku. You can use any DB on your dev machine, including MySQL, it doesn't matter. You don't need to do anything about the 'mysql' reference in your Gemfile.

When you push your app to Heroku, it will be running on PostgreSQL there, but unless you have DB-specific code in your app, it will be fine.