Hi there, in my account i have created a mysql database, and a rails 3 application. I edited the database.yml as specified in this article, and i got the following error:
I then replaced the
I am able to get into my database using phpmysql, so my password should be correct. Anybody has a clue as to what could be wrong? For completeness, here is my database.yml:
(i have obscured my password of course) asked 16 Jan '11, 11:28 nathanvda |
Ha! I found it! I was able to connect to the database from the Sooooo, what was the difference? Apparently inside the database.yml you have to specify So i had to write it as follows to make it work:
(and as you see: i could even use localhost then). answered 16 Jan '11, 13:21 nathanvda That explains it :) Since you did not provide 'username' as a parameter, the DB server assumed you were connecting as root, hence the error message. For what it's worth, our documentation does specify 'username'. :)
(16 Jan '11, 13:38)
seanf
I noticed that too :) The error was completely on my part ;)
(16 Jan '11, 14:10)
nathanvda
|
Where are you seeing the error? In your site, or when running migrate or some other command in SSH?
Hi Sean, when trying to either do
rake db:setup
or starting the Rails console (rails console
) and then trying to get something from db (e.g.Post.all
).If i try
mysql -u nathanvda_voc -h web164 -p
i do get connected succesfully. I am a bit confused :)