# NetBeans 6.0 Rails Support

**URL:** <https://www.ruby-forum.com/t/netbeans-6-0-rails-support/88202>\
**Category:** Rails\
**Created:** [March 8, 2007, 10:01pm UTC](https://www.ruby-forum.com/t/netbeans-6-0-rails-support/88202 "2007-03-08T22:01:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruparel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e47774/32.png) [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Post date:** [March 8, 2007, 10:01pm UTC](https://www.ruby-forum.com/t/netbeans-6-0-rails-support/88202/1 "2007-03-08T22:01:02Z")

</div>

The new Ruby support flash demos on [netbeans.org](http://netbeans.org) site are very good. I  
am trying to duplicate them on my Windows XP machine. Running into

#28000Access denied for user ‘root’@‘localhost’ (using password: YES)

error when trying to run the blog\_controller against MySQL database. I  
have been able to connect to the database from within NetBeans create  
table posts, execute queries etc. I have also set the database  
connection information in the database.yml as follows:

development:  
adapter: mysql  
database: blogdemo\_development  
username: root  
password: bharat  
host: localhost

However, when I run the scaffolding command against the database, I get  
the aforementioned error. Here is the full-stacktrace:

C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active\_record/vendor/mysql.rb:508:in  
`read' C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysql.rb:150:in `real\_connect’  
C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active\_record/connection\_adapters/mysql\_adapter.rb:330:in  
`connect' C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/mysql_adapter.rb:87:in `initialize’  
C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active\_record/connection\_adapters/mysql\_adapter.rb:36:in  
`new' C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/mysql_adapter.rb:36:in `mysql\_connection’  
C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active\_record/connection\_adapters/abstract/connection\_specification.rb:251:in  
`send' C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:251:in `connection=’  
C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active\_record/query\_cache.rb:54:in  
`connection=' C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:220:in `retrieve\_connection’  
C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active\_record/connection\_adapters/abstract/connection\_specification.rb:78:in  
`connection' C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:696:in `columns’  
C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active\_record/calculations.rb:216:in  
`column_for' C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/calculations.rb:138:in `calculate’  
C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active\_record/calculations.rb:66:in  
`count' C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/pagination.rb:175:in `count\_collection\_for\_pagination’  
C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_controller/pagination.rb:196:in  
`paginator_and_collection_for' C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/pagination.rb:129:in `paginate’  
C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_controller/scaffolding.rb:7:in  
`list' C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/scaffolding.rb:2:in `index’  
C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_controller/base.rb:941:in  
`send' C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:941:in `perform\_action’  
C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_controller/filters.rb:368:in  
`perform_action' C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:68:in `perform\_action’  
C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_controller/rescue.rb:82:in  
`measure' C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in `perform\_action’  
C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_controller/rescue.rb:82:in  
`perform_action_with_rescue' C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in `send’  
C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_controller/base.rb:408:in  
`process' C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:377:in `process’  
C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action\_controller/session\_management.rb:117:in  
`process_with_session_management_support' C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in `dispatch’  
C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick\_server.rb:120:in  
`handle_dispatch' C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick_server.rb:83:in `service’  
C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/1.8/webrick/httpserver.rb:104:in  
`service' C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/1.8/webrick/httpserver.rb:65:in `run’  
C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/1.8/webrick/server.rb:173:in  
`start_thread' C:/netbeans/nb6.0/jruby-0.9.2/lib/ruby/1.8/webrick/server.rb:95:in `start’  
Request  
Parameters: None

Show session dump

* * *

flash: !map:ActionController::Flash::FlashHash {}

Response  
Headers: {“Cache-Control”=\>“no-cache”, “cookie”=\>[]}

Was wondering if anyone else has run into this problem? and how to fix  
it?

---

<div class="post-metadata">

**Author:** ![bruparel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e47774/32.png) [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Post date:** [March 8, 2007, 10:14pm UTC](https://www.ruby-forum.com/t/netbeans-6-0-rails-support/88202/2 "2007-03-08T22:14:16Z")

</div>

I have encountered that error with MySQL in the past due to the database  
login permission.

Try (from command line): mysql -h localhost -u root -p bharat

If that can connect, then, MySQL engine is working okay with your  
login/password.

If not, then the password could be incorrect or it allows access from  
other  
machines except for localhost. I fixed my error by changing my password  
(bcoz I forgot what it was!).

E

---

<div class="post-metadata">

**Author:** ![bruparel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e47774/32.png) [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Post date:** [March 8, 2007, 11:55pm UTC](https://www.ruby-forum.com/t/netbeans-6-0-rails-support/88202/3 "2007-03-08T23:55:17Z")

</div>

Hello Elina,  
I reinstalled MySQL, this time, without a password, and disallowed  
remote access and everything works fine. I am not sure how to deal with  
the password issue though. Admittedly, not a very secure system at this  
point.  
Regards,  
Bharat

---

<div class="post-metadata">

**Author:** ![bruparel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e47774/32.png) [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Post date:** [March 8, 2007, 10:51pm UTC](https://www.ruby-forum.com/t/netbeans-6-0-rails-support/88202/4 "2007-03-08T22:51:38Z")

</div>

Elina Law wrote:

> I have encountered that error with MySQL in the past due to the database  
> login permission.
> 
> Try (from command line): mysql -h localhost -u root -p bharat
> 
> If that can connect, then, MySQL engine is working okay with your  
> login/password.
> 
> If not, then the password could be incorrect or it allows access from  
> other  
> machines except for localhost. I fixed my error by changing my password  
> (bcoz I forgot what it was!).
> 
> E

Hello Elina,  
Thanks for the quick response. I don’t have much experience with MySQL  
and therefore must have installed it incorrectly. I went for complete  
installation and installed it as Service. I also said allow remote  
connections when Installing.

Oh. by the way the command did not work,here is the output:

C:\mysql50\bin\>mysql -h localhost -u root -p bharat  
Enter password: \*\*\*\*\*\*  
ERROR 2003 (HY000): Can’t connect to MySQL server on ‘localhost’ (10061)

Something that puzzles me is how is it that I can connect the MySQL  
Command Line client utility that I run from the start menu using the  
same password as ‘bharat’. That puts me in the MySQL environement and I  
can see all the databases, create them etc. Do I have to reset the  
password? Also, the NetBeans client can connect to this database  
without any problems? Perhaps there is something here that I am  
missing??  
Bharat

---

<div class="post-metadata">

**Author:** ![bruparel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e47774/32.png) [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Post date:** [March 9, 2007, 12:29am UTC](https://www.ruby-forum.com/t/netbeans-6-0-rails-support/88202/5 "2007-03-09T00:29:33Z")

</div>

Hi Bharat,

If you are using the password “bharat”, then is the host or the user  
different? I am not familiar with the command line utility that you are  
using.

E

---

<div class="post-metadata">

**Author:** ![bruparel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e47774/32.png) [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Post date:** [March 9, 2007, 4:38am UTC](https://www.ruby-forum.com/t/netbeans-6-0-rails-support/88202/6 "2007-03-09T04:38:18Z")

</div>

Thank you Elina. I will definitely follow through. In the meantime,  
Ruby on NetBeans looks really good, check it out.

---

<div class="post-metadata">

**Author:** ![bruparel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e47774/32.png) [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Post date:** [March 9, 2007, 12:39am UTC](https://www.ruby-forum.com/t/netbeans-6-0-rails-support/88202/7 "2007-03-09T00:39:34Z")

</div>

Hi Bharat,

Didn’t realise you have responded with a “reinstall”. Got pulled away  
from  
my desk.

It would have been the MySQL setup. Try adding a piece of the security  
at a  
time, eg set password, test RoR. Then allow remote access and test RoR.

There are some HowTos on the MySQL site. If your RoR setup is on the  
same  
machine as the database (and you don’t need remote access to administer  
your  
database), you can do without remote access.

Try this HowTo for setting up a non-root user for your RoR application.  
[http://dev.mysql.com/doc/refman/5.0/en/create-user.html](http://dev.mysql.com/doc/refman/5.0/en/create-user.html)

You can use [http://dev.mysql.com/doc/refman/5.0/en/set-password.html](http://dev.mysql.com/doc/refman/5.0/en/set-password.html) to  
help  
secure your root access.

Same login test applies with different user names and password.

E
