1

I’m trying to setup a Heroku app but using a Xeround DB. The instructions I have found are a bit confusing:

http://xeround.com/developers/heroku-cloud-database-mysql/ I'm trying to follow the second way, creating the db directly on Xeround.

My doubts are:

  • Is the Xeround addon required for this? At least heroku addons:add xeround –app xxxx says: That add-on is only available to selected users

  • The Heroku DATABASE_URL needs to be set to: mysql://username:password@host:port/database I've seen some posts with mysql2 and mysql (none has worked for me anyway). My gem file has mysql2, 0.2.7 (for Rails 3.0.x)

  • I can see the config var ok, but Heroku config --app xxx still shows SHARED_DATABASE_URL => postgres://pjyqfgjcbn:.... is that ok?

Then from the instructions the step #5 is really confusing, it is not clear if that part is optional or not (I expect it is). And if it was mandatory it doesn't tell to which file it has to be added ...

My objective is to create a fresh Heroku app, push an existing app I have, set it up to use the Xeround DB and then run Heroku rake db:schema:load but no matter what I try I keep getting:

rake aborted! database configuration does not specify adapter

Any ideas how to set it up?

do the same with Rails 3.0.5 but having some problems and comments. Is the adapter mysql or mysql2? The example on Xeround about the setup site is mysql://username:password@host:port/database

mysql2 is correct gem to use with Rails 3 (mysql 0.2.7 for 3.0.x and latest for 3.1) but the name in the url might be just a name they picked. I guess yours worked but still…

I imagine the Xeround addon of Heroku is not needed right? heroku addons:add xeround –app xxxx says That add-on is only available to selected users

And finally with mysql or mysql2 in the name of the db url when I try to migrate I just get:

rake aborted! database configuration does not specify adapter

Did ask Heroku but no answer yet…

Pod
  • 928
  • 1
  • 10
  • 30
  • Did you ever get an answer on this? If so, please share! – Jonathan Dec 29 '11 at 10:30
  • Hi, actually not. I'm still using the Heroku DB, it is not that urgent at this moment. I might try later on but I actually don't have anything new to try, just maybe a clean start. Are you facing the same problems? – Pod Dec 30 '11 at 11:32

1 Answers1

1

I've been using Xeround for several of my apps hosted on Heroku.

I don't have specific experience with Rails. Sinatra only... But hopefully this helps you out.

I do not use the add-on. It's less expensive to setup an account through Xeround on your own.

Connect to it just like you would any MySQL Database....

Connection String will look just like you stated: mysql://username:password@host:port/database

Host/Port are provided by Xeround in the admin database. Database name would be whatever you setup in phpMyAdmin. User/pass are NOT your Xeround account credentials. They are the credentials you setup for that database instance.

For example... if your ORM is Datamapper... do something like this:

DataMapper.setup(:default, ENV['XEROUND_CONN'])

Or if you're using Sequel:

DB = Sequel.connect(ENV['XEROUND_CONN'])

Then you need to set your XEROUND_CONN (or whatever you wish to call it) ENV variable.

Do this by using the Heroku command

heroku config:add XEROUND_CONN='mysql://username:password@host:port/database'

Warning: Datamapper has an issue with Xeround. Datamapper does not have support for setting your storage engine (myisam..etc..). Xeround uses their own custom Xeround storage engine. So... I've had trouble running auto_migrate due to differences in storage engine.

mscccc
  • 2,190
  • 6
  • 25
  • 39