Forum: Ruby on Rails access denied problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0e762264be393cbd4b485077d2d25e64?d=identicon&s=25 Scott Bishop (Guest)
on 2006-01-18 22:23
(Received via mailing list)
Hello

I've started working through the book "Agile web development with
Rails" and so far everything has been great.

I'm on page 56, 57 trying to create the admin tool for the example
project "Depot".

  I'm on OS X Panther 10.3.9.  I have checked the Errata on the website
and tried some of the suggestions there, but nothing has worked.   When
I type....    ruby/generate scaffold Product Admin  I get an error that
says Access denied for user 'root'@'localhost' (using password: NO).

In the book it states this could be a problem with leaving parts of the
database.yml config file blank.  I've tried both leaving it blank and
filling in an explicit user and password.  I still get the same error.

When I tried to view the page at localhost:3000/admin I get the error
Routing Error Recognition failed for "/admin".

I'm not sure where to go from here.  When I originally set up Ruby and
Ruby on Rails on my machine I followed a tutorial from the O'Reilly
network and the database connections worked just fine.  (I know this
because I remember being completely amazed at how I could alter the db
and have the admin section change instantly!)

The only thing I have changed from the time of doing the O'Reilly
tuturial and buying the books is upgrading to Rails 1.0.

I've tried entering the username as root and the root pass in the
database.yml configuration, but that didn't seem to work.  I don't know
why Rails continues to try to access the db as root.

I've checked my priveleges in mysql (4.1.14) and everything seems to be
ok for the user I have set up for the "Depot" example.  I've even
connected with the user to the db through the console.  So, to the best
of my knowledge the user I'm connecting under has the right access to
the db.

Since the website suggested turning to this mailing list for help....
here I am.  I hope someone out there is apply to help.

Thanks very much.
Scott
119af50160cabfe1fb6f2f05f5018c64?d=identicon&s=25 James Ludlow (Guest)
on 2006-01-18 22:44
(Received via mailing list)
On 1/18/06, Scott Bishop <scott.bishop@mac.com> wrote:
> I've checked my priveleges in mysql (4.1.14) and everything seems to be
> ok for the user I have set up for the "Depot" example.  I've even
> connected with the user to the db through the console.  So, to the best
> of my knowledge the user I'm connecting under has the right access to
> the db.

The error message says that you're trying to connect as root.  Is that
what you expected?
0e762264be393cbd4b485077d2d25e64?d=identicon&s=25 Scott Bishop (Guest)
on 2006-01-18 22:53
(Received via mailing list)
No, didn't expect to connect to as root at all.  I set up the databases
as directed in the example, used an existing user (scott) and granted
all privileges to that user.

Access denied error showed up when I moved on to the next step for
creating the scaffold for the admin tools.

<scott />
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (Guest)
on 2006-01-19 10:33
(Received via mailing list)
Scott Bishop wrote:
> No, didn't expect to connect to as root at all.  I set up the databases
> as directed in the example, used an existing user (scott) and granted
> all privileges to that user.
>
> Access denied error showed up when I moved on to the next step for
> creating the scaffold for the admin tools.
Care to post your database.yml (with passwords masked, of course)?
0e762264be393cbd4b485077d2d25e64?d=identicon&s=25 Scott Bishop (Guest)
on 2006-01-19 15:20
(Received via mailing list)
Alex

As you requested, here is the database.yml, minus the passwords.

development:
   adapter: mysql
   database: depot_development
   host: localhost
   username: scott
   password: mypass

test:
   adapter: mysql
   database: depot_test
   host: localhost
   username: scott
   password: mypass

production:
   adapter: mysql
   database: depot_production
   host: localhost
   username: scott
   password: mypass

When I got the error that said access denied, I assumed Rails was
trying to access the db as root.  So I also tried on the development
settings to put "root" and my db root pass into the username and
password but I still got the same error.

Thanks
Scott
2a80e0717a377ddb1fb0fc70958230c9?d=identicon&s=25 Spiky (Guest)
on 2006-09-20 16:50
Hi Scott,

I spent ages on this and eventually found a suggestion somewhere that
recommended killing off the ruby processes - problem appears to be that
ruby isn't (always) picking up the latest changes in the database.yml
file.

It working for me,

Spiky
This topic is locked and can not be replied to.