Can't connect to mysql from rails

software development

#1

Hi
I really can’t figure out why my RoR app can’t connect to the DB.
I have been working all day trying to deploy my application and finally got it almost right, but now I get an 505 error and when checking the production log I am told the following:

Mysql::Error (Access denied for user ‘eurytmih’@‘eros.dreamhost.com’ (using password: YES)):

I can log in to my db server from the command line when SSH-ing to the server and when checking in the dreamhost panel I see that DB access is restricted to %.dreamhost.com, which should be fine since the DB is being accessed by eros.dreamhost.com.

My database.yml looks like this:

production:
adapter: mysql
database: webside_production
username: *******
password: *******
host: *******

I am able to log in from the command line with exactly the same information, but my RoR app can’t…
What also strikes me as a little odd is that I had problems when trying to run the migrations on the server. For some reasons it tried to use the development environment, when I forced it to deploy using the production environment it worked though. But this can’t be the case with this error listed above because the username being used on my local machine when developing is a totally different one!

Hope you have any suggestions!

Best regards
Sebastian


#2

Yeho!
I finally found the reason why I got the error.
It was nothing you could have helped me with really, and just the result of a to long day at work and not enough caffeine :slight_smile:

I had forgotten that the capistrano recipe I was using generates a new database.yml file as one of the last thing it does and the password in the generated file was wrong… That’s why I couldn’t get why my local database.yml didn’t work and why the error stayed the same regardless of how I tweaked the settings in my database file! But now it’s working! Hip hurray!

best regards
Sebastian