Forum: Ruby on Rails NetBeans 6.0 Rails Support

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.
D3fc5887a2f39f2e0c8989d39ce5e6f9?d=identicon&s=25 Bharat Ruparel (bruparel)
on 2007-03-08 22:01
The new Ruby support flash demos on 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?
F2ca3d0c2f322238910c91b9ec656a99?d=identicon&s=25 Elina Law (Guest)
on 2007-03-08 22:14
(Received via mailing list)
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
D3fc5887a2f39f2e0c8989d39ce5e6f9?d=identicon&s=25 Bharat Ruparel (bruparel)
on 2007-03-08 22:51
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
D3fc5887a2f39f2e0c8989d39ce5e6f9?d=identicon&s=25 Bharat Ruparel (bruparel)
on 2007-03-08 23:55
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
F2ca3d0c2f322238910c91b9ec656a99?d=identicon&s=25 Elina Law (Guest)
on 2007-03-09 00:29
(Received via mailing list)
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
F2ca3d0c2f322238910c91b9ec656a99?d=identicon&s=25 Elina Law (Guest)
on 2007-03-09 00:39
(Received via mailing list)
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

You can use 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
D3fc5887a2f39f2e0c8989d39ce5e6f9?d=identicon&s=25 Bharat Ruparel (bruparel)
on 2007-03-09 04:38
Thank you Elina.  I will definitely follow through.  In the meantime,
Ruby on NetBeans looks really good, check it out.
This topic is locked and can not be replied to.