0

I am trying to deploy a rails app to Heroku for the first time. I am trying to connect my ruby on rails app which has a MySQL database. I am not sure if I have missed out on some steps but whenever I try to access heroku's provided url, I get the message "We're sorry, but something went wrong." and it asks to check the logs.

When I check Heroku logs, what I can make out of it is I see something like

ActionView::Template::Error (Access denied for user 'adffdadf2341'@'ip-10-187-29-34.ec2.internal' (using password: YES)):

I have created a ClearDB add on and I've set the following

CLEARDB_DATABASE_URL:     mysql2://adffdadf2341:adf4234@us-cdbr-east.cleardb.com/heroku_db?reconnect=true
I've set this to DATABASE_URL as well.

I'm not sure if all my config files or database.yml are as it should be. Also things to note are I am using gems like Paperclip and Devise.To make sure my Paperclip works properly I am using AWS.

My github repo is on the following https://github.com/esjayrockz/Savour

Can you please check this and say if I'm missed out on anything.

  • That DB URL you mentioned here `mysql2://adffdadf2341:adf4234@us-cdbr-east.cleardb.com/...` is the actual URL or it is just for representation purpose only, and your actual URL is different from what you have posted here? – Sajan Apr 26 '17 at 04:48
  • That is the actual URL. I get this when I do `$ heroku config | grep CLEARDB_DATABASE_URL` `CLEARDB_DATABASE_URL: mysql2://adffdadf2341:adf4234@us-cdbr-east.cleardb.com/heroku_db?reconnect=true` – Suvajit Chakrabarty Apr 26 '17 at 04:56
  • Okay but in their [article](https://devcenter.heroku.com/articles/cleardb#provisioning-the-add-on) , I can see that they have mentioned the same URL. I don't think this should be the only URL for all of their users. Your URL should be different. – Sajan Apr 26 '17 at 05:09
  • How do I know what my URL should be ? As per their article they have written that copy the value of CLEARDB_DATABASE_URL. And to know this value do `$ heroku config | grep CLEARDB_DATABASE_URL`. When I do that, I get this URL. – Suvajit Chakrabarty Apr 26 '17 at 05:15

2 Answers2

0

Password is wrong for the user so cannot connect to the MySQL DB. Try these commands in your console:

mysql -u root -p

And when prompted, give the password as 'admin'

If this is possible, then you should be good to go.

Rakesh
  • 284
  • 2
  • 5
0

Heroku work with postgres database only so remove mysql from gemfile and add below line:

gem 'pg'
puneet18
  • 4,341
  • 2
  • 21
  • 27