When I run a command program (rails 3/ruby 1.9.2) as this: class MsdsAttr < ActiveRecord::Base include MsdsAttrModule belongs_to :attribute_record, :polymorphic => true has_many :attribute_values, :foreign_key => ''attribute_id'' has_many :alt_values, :as => :alternative has_many :msds_ingredients end ActiveRecord::Base.establish_connection( :adapter => "mysql", :host => "localhost", :database => "univ_parse_dev", :user => "PZZ", :password => "PZZ" ) attr = MsdsAttr.find(:first) I get the error below even though I didn''t try to connect using root. Running rails server/console etc doesn''t have this problem .. C:\inetpub\wwwroot\Larry\univ-parse>ruby db-test.rb C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/lib/ active_record/connect ion_adapters/mysql_adapter.rb:614:in `real_connect'': Access denied for user ''roo t''@''localhost'' (using password: YES) (Mysql::Error) from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/connection_adapters/mysql_adapter.rb:614:in `connect'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/connection_adapters/mysql_adapter.rb:164:in `initialize'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/connection_adapters/mysql_adapter.rb:36:in `new'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/connection_adapters/mysql_adapter.rb:36:in `mysql_connection'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/connection_adapters/abstract/connection_pool.rb:229:in `new_connection'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/connection_adapters/abstract/connection_pool.rb:237:in `checkout_new_conne ction'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/connection_adapters/abstract/connection_pool.rb:191:in `block (2 levels) i n checkout'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/connection_adapters/abstract/connection_pool.rb:187:in `loop'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/connection_adapters/abstract/connection_pool.rb:187:in `block in checkout'' from C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/connection_adapters/abstract/connection_pool.rb:186:in `checkout'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/connection_adapters/abstract/connection_pool.rb:94:in `connection'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/connection_adapters/abstract/connection_pool.rb:317:in `retrieve_connectio n'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/connection_adapters/abstract/connection_specification.rb:97:in `retrieve_c onnection'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/connection_adapters/abstract/connection_specification.rb:89:in `connection '' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/relation.rb:370:in `block in method_missing'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/relation.rb:125:in `scoping'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/relation.rb:370:in `method_missing'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/relation/query_methods.rb:182:in `build_arel'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/relation/query_methods.rb:149:in `arel'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/relation.rb:64:in `to_a'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/relation/finder_methods.rb:341:in `find_first'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/relation/finder_methods.rb:122:in `first'' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/ lib/active_r ecord/relation/finder_methods.rb:105:in `find'' from C:in `find'' from db-test.rb:18:in `<main>'' C:\inetpub\wwwroot\Larry\univ-parse> -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.