# Scaffold Generation Problem

**URL:** <https://www.ruby-forum.com/t/scaffold-generation-problem/59545>\
**Category:** Rails\
**Created:** [May 4, 2006, 12:53am UTC](https://www.ruby-forum.com/t/scaffold-generation-problem/59545 "2006-05-04T00:53:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![doug3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b3f665/32.png) [@doug3](https://www.ruby-forum.com/u/doug3)\
**Post date:** [May 4, 2006, 12:53am UTC](https://www.ruby-forum.com/t/scaffold-generation-problem/59545/1 "2006-05-04T00:53:41Z")

</div>

Greetings all,

I’m sure there is probably a very obvious reason for the following  
problem. However, after much hair pulling, I am just not seeing it yet.  
As you can see from the trace below, I am not able to complete scaffold  
generation due to some problem between rails and mysql. I double  
checked MySQL to make sure both my Ruby user and Root user have full  
rights to the database. However, for some reason “C:\> generate  
scaffold User Admin::User” always hangs up right after “create  
test/fixtures/users.yml”

Any ideas why this might be happening or how it might be fixed would be  
greatly appreciated.

THNX

> generate scaffold User Admin::User  
> create app/controllers/admin  
> create app/helpers/admin  
> create app/views/admin/user  
> create test/functional/admin  
> dependency model  
> exists app/models/  
> exists test/unit/  
> exists test/fixtures/  
> create app/models/user.rb  
> create test/unit/user\_test.rb  
> create test/fixtures/users.yml  
> #28000Access denied for user ‘root’@‘localhost’ (using password: NO)

---

<div class="post-metadata">

**Author:** ![doug3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b3f665/32.png) [@doug3](https://www.ruby-forum.com/u/doug3)\
**Post date:** [May 4, 2006, 1:03am UTC](https://www.ruby-forum.com/t/scaffold-generation-problem/59545/2 "2006-05-04T01:03:10Z")

</div>

Does your database.yml file have the correct login information for user  
root?

On 5/3/06, doug meharry [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> dependency model  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–  
Ben R.  
303-947-0446  
[http://www.benr75.com](http://www.benr75.com)

---

<div class="post-metadata">

**Author:** ![doug3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b3f665/32.png) [@doug3](https://www.ruby-forum.com/u/doug3)\
**Post date:** [May 4, 2006, 1:06am UTC](https://www.ruby-forum.com/t/scaffold-generation-problem/59545/3 "2006-05-04T01:06:12Z")

</div>

Hey Doug, you simply need to add the password to your .yml file.

Peace,

-Conrad

---

<div class="post-metadata">

**Author:** ![doug3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b3f665/32.png) [@doug3](https://www.ruby-forum.com/u/doug3)\
**Post date:** [May 4, 2006, 2:52am UTC](https://www.ruby-forum.com/t/scaffold-generation-problem/59545/4 "2006-05-04T02:52:25Z")

</div>

Conrad T. wrote:

> Hey Doug, you simply need to add the password to your .yml file.
> 
> Peace,
> 
> -Conrad

Thanks guys!

After an hour off I came back and realized (1) the .yml file I wanted to  
use was in the wrong folder(I screwed up and copied one from another  
working project to the DB folder instead of the environments folder; and  
(2) the .yml file in the environments folder was trying to use the  
“root” user account to access the database instead of the “ruby” user I  
had set up specifically for the purpose. For some reason it seems Ruby  
and MySQL don’t play well together on Windows XP systems so one needs to  
employ a user account that does not have a password(as shown below).  
Anyhow, problem solved.

Doug

Below is an excerpt from “database.yml” file – note this works:

development:  
adapter: mysql  
database: mydatabase\_development  
username: ruby2  
password:

---

<div class="post-metadata">

**Author:** ![doug3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b3f665/32.png) [@doug3](https://www.ruby-forum.com/u/doug3)\
**Post date:** [May 4, 2006, 4:59pm UTC](https://www.ruby-forum.com/t/scaffold-generation-problem/59545/5 "2006-05-04T16:59:54Z")

</div>

Louis Erickson wrote:

> All I can suggest is to try the user and password from the command line to  
> make sure they’re right, and to see if you have any funny characters that  
> YAML might not like. I’ve been bit by both of these recently. (I can  
> never get mysql’s security right on the first try.)  
> Also to bear in mind is the password format change from 4.0 to 4.1.  
> Probably not relevant, but you never know…

---

<div class="post-metadata">

**Author:** ![doug3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b3f665/32.png) [@doug3](https://www.ruby-forum.com/u/doug3)\
**Post date:** [May 4, 2006, 4:56pm UTC](https://www.ruby-forum.com/t/scaffold-generation-problem/59545/6 "2006-05-04T16:56:46Z")

</div>

On Thu, 4 May 2006, doug meharry wrote:

> For some reason it seems Ruby  
> and MySQL don’t play well together on Windows XP systems so one needs to  
> employ a user account that does not have a password(as shown below).

I’m using Rails on XP with MySQL with users that have passwords, so  
there  
has to be something else going on there.

My database.yml looks like this:

development:  
adapter: mysql  
database: project\_dev  
username: devuser  
password: qwertyy  
host: localhost

(I did change the values of the fields. What good is having a password  
if  
you go and post it to the Internet? =). )

Passwords and mysql work fine for me under XP on several projects.

All I can suggest is to try the user and password from the command line  
to  
make sure they’re right, and to see if you have any funny characters  
that  
YAML might not like. I’ve been bit by both of these recently. (I can  
never get mysql’s security right on the first try.)

> Anyhow, problem solved.

Glad to hear it. It’s amazing what taking a break can do for you  
sometimes. =)

–  
Louis Erickson - removed\_email\_address@domain.invalid - [Lou's Home Page!](http://www.rdwarf.com/~wwonko/)

I have discovered the art of deceiving diplomats. I tell them the truth  
and they never believe me.  
– Camillo Di Cavour

---

<div class="post-metadata">

**Author:** ![doug3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b3f665/32.png) [@doug3](https://www.ruby-forum.com/u/doug3)\
**Post date:** [May 4, 2006, 6:41pm UTC](https://www.ruby-forum.com/t/scaffold-generation-problem/59545/7 "2006-05-04T18:41:05Z")

</div>

Alex Y. wrote:

> Louis Erickson wrote:
> 
> > All I can suggest is to try the user and password from the command line to  
> > make sure they’re right, and to see if you have any funny characters that  
> > YAML might not like. I’ve been bit by both of these recently. (I can  
> > never get mysql’s security right on the first try.)  
> > Also to bear in mind is the password format change from 4.0 to 4.1.  
> > Probably not relevant, but you never know…

Alex and Louis,

I think there may be an issue between RoR and MySQL version 4.1 (the  
version I am running). I also seem to recall some posts here about this  
problem and that it seems to only occur on Windows systems (big surprise  
huh?). When I specify a password for my “ruby” user, I get the  
following error message from RoR:

```
28000 Access denied for user 'ruby'@'localhost' (using password: NO)

```

When I take the password out (both in MySQL and RoR of course)  
everything works fine. Of course, security sucks, but then again this  
is just a development environment. Deployment will most likely be on a  
Linux box, so I don’t think (or at least I hope) this will not be a  
problem. Also, it is one of those things that might get taken care of  
well before I am ready to deploy.

Doug
