0

I am beginner on Heroku. I push my exist ruby on rails application into heroku and that was fine. Next i push my mysql data into heroku with 'push' command as following.

$heroku config:add DATABASE_URL='mysql2://<my CLEARDB_DATABASE_URL>@<myapp>.herokuapp.com/heroku_db?reconnect=true'
$heroku db:push mysql2://<my CLEARDB_DATABASE_URL>@<myapp>.herokuapp.com/<my dump file>

But i got error as following.

Failed to connect to database:
Sequel::DatabaseConnectionError -> Mysql2::Error: Can't connect to MySQL server on '<myapp>.herokuapp.com' (110)

I am confusing what should i do. Someone tell me how to resolve it.

Many thanks.

-Ono

onoke
  • 79
  • 6
  • I notice that heroku ignite provided 'mysql://' not 'mysql2://' on CLEARDAB_DATABASE_URL. And my app was using 'mysql2://'. Dose ignite not provide 'mysql2://'? – onoke Mar 27 '13 at 03:19

1 Answers1

0

Don't use db:push or db:pull. Please export a sql file locally and either pipe it in like so:

$ heroku pg:psql DATABASE_URL -a app_name < file.sql

Or better, use Postgres locally and use pgbackups to import/export like so: Importing and Exporting Heroku Postgres Databases with PG Backups

catsby
  • 11,276
  • 3
  • 37
  • 37