John Kopanas
2005-Mar-23 18:49 UTC
Can''t connect to local MySQL server through socket ''/tmp/mysql.sock'' (61)
I am getting random can''t connect to MySQL server errors on my Rails application located at http://www.thedatingguy.com/blog Do you have any clue why this is happening? This is the error: Mysql::Error (Can''t connect to local MySQL server through socket ''/tmp/mysql.sock'' (61)): /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/connection_adapters/mysql_adapter.rb:39:in `real_connect'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/connection_adapters/mysql_adapter.rb:39:in `mysql_connection'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/connection_adapters/abstract_adapter.rb:136:in `send'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/connection_adapters/abstract_adapter.rb:136:in `connection='' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/connection_adapters/abstract_adapter.rb:100:in `retrieve_connection'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:222:in `connection'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:861:in `quote_bound_value'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:841:in `replace_bind_variables'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:841:in `gsub'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:841:in `replace_bind_variables'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:830:in `sanitize_sql'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:732:in `add_conditions!'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:356:in `find_all'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:378:in `find_first'' /app/models/user.rb:7:in `authenticate'' app/controllers/account_controller.rb:12:in `login'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:691:in `send'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:691:in `perform_action_without_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/filters.rb:294:in `perform_action_without_benchmark'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/benchmarking.rb:30:in `perform_action_without_rescue'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/benchmarking.rb:30:in `measure'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/benchmarking.rb:30:in `perform_action_without_rescue'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/rescue.rb:79:in `perform_action'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:323:in `send'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:323:in `process'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:266:in `process'' /usr/local/lib/ruby/gems/1.8/gems/rails-0.11.0/lib/dispatcher.rb:32:in `dispatch'' dispatch.cgi:10
Joe Van Dyk
2005-Mar-23 19:51 UTC
Re: Can''t connect to local MySQL server through socket ''/tmp/mysql.sock'' (61)
On Wed, 23 Mar 2005 13:49:26 -0500, John Kopanas <john.kopanas-O1KSuMybMhqBUy7/sJONFg@public.gmane.org> wrote:> I am getting random can''t connect to MySQL server errors on my Rails application > located at http://www.thedatingguy.com/blog > > Do you have any clue why this is happening? > > This is the error: > > Mysql::Error (Can''t connect to local MySQL server through socket > ''/tmp/mysql.sock'' (61)): > > /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/connection_adapters/mysql_adapter.rb:39:in > `real_connect'' > > /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/connection_adapters/mysql_adapter.rb:39:in > `mysql_connection'' > > /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/connection_adapters/abstract_adapter.rb:136:in > `send'' > > /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/connection_adapters/abstract_adapter.rb:136:in > `connection='' > > /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/connection_adapters/abstract_adapter.rb:100:in > `retrieve_connection'' > > /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:222:in > `connection'' > > /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:861:in > `quote_bound_value'' > > /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:841:in > `replace_bind_variables'' > > /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:841:in > `gsub'' > > /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:841:in > `replace_bind_variables'' > > /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:830:in > `sanitize_sql'' > > /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:732:in > `add_conditions!'' > > /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:356:in > `find_all'' > > /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:378:in > `find_first'' > /app/models/user.rb:7:in `authenticate'' > app/controllers/account_controller.rb:12:in `login'' > > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:691:in > `send'' > > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:691:in > `perform_action_without_filters'' > > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/filters.rb:294:in > `perform_action_without_benchmark'' > > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/benchmarking.rb:30:in > `perform_action_without_rescue'' > > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/benchmarking.rb:30:in > `measure'' > > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/benchmarking.rb:30:in > `perform_action_without_rescue'' > > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/rescue.rb:79:in > `perform_action'' > > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:323:in > `send'' > > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:323:in > `process'' > > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:266:in > `process'' > /usr/local/lib/ruby/gems/1.8/gems/rails-0.11.0/lib/dispatcher.rb:32:in > `dispatch'' > dispatch.cgi:10Does /tmp/mysql.sock exist? If not, then you''ll either need to change database.yml to reflect the new mysql socket location, or (what I do) create a symbolic link from the mysql socket to /tmp/mysql.sock.