I need some help

hi, i am new to the ruby on rails.

i am trying to create one web application using ror, i created directory
structure and started webrick server, after the when go for
http://127.0.0.1:3000/, it gives the home page, after that i created one
controller and rhtml file regarding that controller.
but when i want to access that from the browser it gives the error like
this “Access denied for user ‘root’@‘localhost’ (using password: NO)”.
can any bady just help me to rectify this problam. i am using rails
2.0.2 and mysql 5.0 versions.

Hi,

That sounds like you haven’t set up your database.yml file correctly.

Simon

On Thu, 02 Jul 2009 20:11:33 +0800, Rajendra B.

On Thu, Jul 2, 2009 at 8:11 AM, Rajendra
Bayana[email protected] wrote:

“Access denied for user ‘root’@‘localhost’ (using password: NO)”.

This is coming from MySql. You need to set up config/database.yml to
match your mysql setup.

You can run mysql with no password for the root user, which is not
advisable, but is often done in a DEVELOPMENT environment. It looks
like your mysql setup requires a root user password.

You can remove the password, if the machine is totally under your
control, I can’t recall the details but a little googling should find
them for you.

The other alternative is to put the root mysql password in the
config/database.yml file.

The more normal setup is to create a mysql user for the Rails app, and
give it access to only the databases and tables it needs. You really
want to do something like this for the deployed production action.


Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale