Heroku and MySQL

26 views
Skip to first unread message

ghilly

unread,
Jan 6, 2012, 3:39:04 AM1/6/12
to rubyonra...@googlegroups.com
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

Walter Lee Davis

unread,
Jan 6, 2012, 8:05:01 AM1/6/12
to rubyonra...@googlegroups.com
On Jan 6, 2012, at 3:39 AM, ghilly wrote:

> 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?

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

Greg Akins

unread,
Jan 6, 2012, 9:07:42 AM1/6/12
to rubyonra...@googlegroups.com
On Fri, Jan 6, 2012 at 5:05 AM, Walter Lee Davis <wa...@wdstudio.com> wrote:

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

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
--
Greg Akins
http://twitter.com/akinsgre

Walter Lee Davis

unread,
Jan 6, 2012, 9:26:02 AM1/6/12
to rubyonra...@googlegroups.com

On Jan 6, 2012, at 9:07 AM, Greg Akins wrote:

> On Fri, Jan 6, 2012 at 5:05 AM, Walter Lee Davis <wa...@wdstudio.com> wrote:
>
>>
>> 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

> I wouldn't know for sure; but from the OP I'd guess they don't do the
> same for MySQL


> --
> Greg Akins
> http://twitter.com/akinsgre
>

> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>

Greg Akins

unread,
Jan 6, 2012, 9:29:31 AM1/6/12
to rubyonra...@googlegroups.com
On Fri, Jan 6, 2012 at 6:26 AM, Walter Lee Davis <wa...@wdstudio.com> wrote:
>> 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?
>

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

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.

Hassan Schroeder

unread,
Jan 6, 2012, 10:26:04 AM1/6/12
to rubyonra...@googlegroups.com

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?

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

ghilly

unread,
Jan 7, 2012, 1:23:27 AM1/7/12
to rubyonra...@googlegroups.com
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.

Hassan Schroeder

unread,
Jan 7, 2012, 11:00:08 AM1/7/12
to rubyonra...@googlegroups.com
On Fri, Jan 6, 2012 at 10:23 PM, ghilly <mlev...@gmail.com> wrote:
> Ok, I misunderstood - I thought you could keep your mysql gem.  I  migrated
> to Postgres and made a few controller tweaks and it worked.

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.

Reply all
Reply to author
Forward
0 new messages