Hi,

I am getting the error "Access denied for user 'root'@'localhost' (using
password: YES)" in my application. I have granted full permissions for
the device in mysql.

My applications runs perfectly fine. But if i keep the browser idle for
some time and then try to load the page I get the above error. When I do
ctrl + F5 few times the app is up and running.

Why am I getting such an error? The same code with the same DB is
running fine in another system.

Any help is appreciated.

Regards,
Madhu.

--
Posted via http://www.ruby-forum.com/.

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Peter Vandenabeele at Jan 3, 2012 at 12:47 pm

    On Tue, Jan 3, 2012 at 1:30 PM, Madhusudhan H R wrote:

    Hi,

    I am getting the error "Access denied for user 'root'@'localhost' (using
    password: YES)" in my application. I have granted full permissions for
    the device in mysql.

    My applications runs perfectly fine. But if i keep the browser idle for
    some time and then try to load the page I get the above error. When I do
    ctrl + F5 few times the app is up and running.

    Why am I getting such an error? The same code with the same DB is
    running fine in another system.

    Any help is appreciated.
    Could you show:

    Operating system on which the server is running?
    Which Rails version?
    Is that database on the same server, same user, different server?
    (I presume you are going over TCP/IP ?)
    Content of config/database.yml (hide the password !).
    Do you see an error trace in your log file (grep for FATAL or '500')

    Thanks,

    Peter

    --
    Peter Vandenabeele
    http://twitter.com/peter_v
    http://rails.vandenabeele.com

    --
    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@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
  • Madhusudhan H R at Jan 3, 2012 at 12:59 pm
    I am running it on windows 2003 VM.
    Rails versions in 2.3.5. Database is in another server not the same
    server.

    Here is the database.yml conf

    development:
    adapter: mysql
    encoding: utf8
    database: db
    username: root
    password: ***
    host: 172.16.1.50
    port: 3306

    Yes the request is through TCP/IP.

    Below is the error trace:

    /!\ FAILSAFE /!\ Tue Jan 03 18:38:51 +0530 2012
    Status: 500 Internal Server Error
    Lost connection to MySQL server during query
    c:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapte
    rs/mysql_adapter.rb:597:in `real_connect'
    c:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapte
    rs/mysql_adapter.rb:597:in `connect'
    c:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapte
    rs/mysql_adapter.rb:203:in `initialize'
    c:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapte
    rs/mysql_adapter.rb:75:in `new'
    c:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapte
    rs/mysql_adapter.rb:75:in `mysql_connection'
    c:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapte
    rs/abstract/connection_pool.rb:223:in `send'
    c:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapte
    rs/abstract/connection_pool.rb:223:in `new_connection'
    c:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapte
    rs/abstract/connection_pool.rb:245:in `checkout_new_connection'
    c:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapte
    rs/abstract/connection_pool.rb:188:in `checkout'
    c:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapte
    rs/abstract/connection_pool.rb:184:in `loop'
    c:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapte
    rs/abstract/connection_pool.rb:184:in `checkout'
    c:/Ruby187/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    c:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapte
    rs/abstract/connection_pool.rb:183:in `checkout'
    c:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapte
    rs/abstract/connection_pool.rb:98:in `connection'
    c:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapte
    rs/abstract/connection_pool.rb:326:in `retrieve_connection'
    c:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapte
    rs/abstract/connection_specification.rb:123:in `retrieve_connection'
    c:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapte
    rs/abstract/connection_specification.rb:115:in `connection'
    c:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:
    in `cache'
    c:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28
    :in `call'
    c:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapte
    rs/abstract/connection_pool.rb:361:in `call'
    c:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion
    .rb:25:in `call'
    c:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in
    `call'
    c:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in
    `call'
    c:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/params_parser.r
    b:15:in `call'
    c:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/session/cookie_
    store.rb:93:in `call'
    c:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:
    in `call'
    c:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in
    `call'
    c:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in
    `synchronize'
    c:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in
    `call'
    c:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:1
    14:in `call'
    c:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:34:
    in `run'
    c:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:1
    08:in `call'
    c:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in
    `call'
    c:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in
    `call'
    c:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in
    `each'
    c:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in
    `call'
    c:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:17:in
    `call'
    c:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:13:in
    `call'
    c:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/chunked.rb:15:in
    `call'
    c:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:64:in
    `process'

    c:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/lib/mongrel.rb:159:in
    `proce
    ss_client'
    c:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/lib/mongrel.rb:158:in
    `each'

    c:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/lib/mongrel.rb:158:in
    `proce
    ss_client'
    c:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/lib/mongrel.rb:285:in
    `run'
    c:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/lib/mongrel.rb:285:in
    `initi
    alize'
    c:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/lib/mongrel.rb:285:in
    `new'
    c:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/lib/mongrel.rb:285:in
    `run'
    c:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/lib/mongrel.rb:268:in
    `initi
    alize'
    c:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/lib/mongrel.rb:268:in
    `new'
    c:/Ruby187/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mingw32/lib/mongrel.rb:268:in
    `run'
    c:/Ruby187/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:34:in
    `run'
    c:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:111
    c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
    `gem_original_require
    '
    c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
    `require'
    script/server:3

    --
    Posted via http://www.ruby-forum.com/.

    --
    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@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
  • Peter Vandenabeele at Jan 3, 2012 at 2:15 pm

    On Tue, Jan 3, 2012 at 1:59 PM, Madhusudhan H R wrote:

    I am running it on windows 2003 VM.
    Rails versions in 2.3.5. Database is in another server not the same
    server.
    ...

    Thank you :-)

    Sorry, I have little experience with this combination. I hope others
    can help here.

    Peter

    --
    Peter Vandenabeele
    http://twitter.com/peter_v
    http://rails.vandenabeele.com

    --
    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@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
  • Alex Mercer at Jan 3, 2012 at 2:56 pm
    hmm.. try to add in config/database.yml below `password` this line:
    ` reconnect: true`

    On Jan 3, 4:15 pm, Peter Vandenabeele wrote:
    On Tue, Jan 3, 2012 at 1:59 PM, Madhusudhan H R wrote:

    I am running it on windows 2003 VM.
    Rails versions in 2.3.5. Database is in another server not the same
    server.
    ...

    Thank you :-)

    Sorry, I have little experience with this combination. I hope others
    can help here.

    Peter

    --
    Peter Vandenabeelehttp://twitter.com/peter_vhttp://rails.vandenabeele.com
    --
    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@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedJan 3, '12 at 12:30p
activeJan 3, '12 at 2:56p
posts5
users3
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2021 Grokbase