Project

General

Profile

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) (Mysql::Error)

Added by Stanley Mendes about 11 years ago

I can not access the redmine.

Erro:

Ruby on Rails application could not be started
There appears to be a database problem.
Your config/database.yml may not be written correctly. Please check it and fix any errors.
Your database schema may be out of date or nonexistant. Please run rake db:migrate to ensure that the database schema is up-to-date.
The database server may not be running. Please check whether it's running, and start it if it isn't.
Error message:
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) (Mysql::Error)
Exception class:
Mysql::Error
Application root:
/usr/share/redmine
Backtrace:
#    File    Line    Location
0    /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/mysql_adapter.rb    620    in `real_connect'
1    /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/mysql_adapter.rb    620    in `connect'
2    /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/mysql_adapter.rb    203    in `initialize'
3    /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/mysql_adapter.rb    75    in `new'
4    /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/mysql_adapter.rb    75    in `mysql_connection'
5    /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb    223    in `send'
6    /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb    223    in `new_connection'
7    /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb    245    in `checkout_new_connection'
8    /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb    188    in `checkout'
9    /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb    184    in `loop'
10    /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb    184    in `checkout'
11    /usr/lib/ruby/1.8/monitor.rb    242    in `synchronize'
12    /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb    183    in `checkout'
13    /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb    98    in `connection'
14    /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb    326    in `retrieve_connection'
15    /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_specification.rb    117    in `retrieve_connection'
16    /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_specification.rb    109    in `connection'
17    /usr/share/redmine/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb    218    in `quoted_left_column_name'
18    /usr/share/redmine/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb    93    in `acts_as_nested_set'
19    /usr/share/redmine/app/models/issue.rb    37    
20    /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb    36    in `gem_original_require'
21    /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb    36    in `require'
22    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    184    in `require'
23    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    291    in `require_or_load_without_engine_additions'
24    /usr/share/redmine/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb    132    in `require_or_load'
25    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    451    in `load_missing_constant'
26    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    106    in `const_missing'
27    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    118    in `const_missing'
28    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    463    in `load_missing_constant'
29    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    122    in `const_missing'
30    /usr/share/redmine/app/models/project.rb    40    
31    /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb    36    in `gem_original_require'
32    /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb    36    in `require'
33    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    184    in `require'
34    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    291    in `require_or_load_without_engine_additions'
35    /usr/share/redmine/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb    132    in `require_or_load'
36    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    451    in `load_missing_constant'
37    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    106    in `const_missing'
38    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    118    in `const_missing'
39    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    463    in `load_missing_constant'
40    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    122    in `const_missing'
41    /usr/share/redmine/app/models/attachment.rb    37    
42    /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb    36    in `gem_original_require'
43    /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb    36    in `require'
44    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    184    in `require'
45    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    291    in `require_or_load_without_engine_additions'
46    /usr/share/redmine/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb    132    in `require_or_load'
47    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    451    in `load_missing_constant'
48    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    106    in `const_missing'
49    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    118    in `const_missing'
50    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    463    in `load_missing_constant'
51    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    106    in `const_missing'
52    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    463    in `load_missing_constant'
53    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    106    in `const_missing'
54    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    463    in `load_missing_constant'
55    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    106    in `const_missing'
56    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    463    in `load_missing_constant'
57    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    106    in `const_missing'
58    /usr/share/redmine/vendor/plugins/acts_as_attachable/lib/acts_as_attachable.rb    33    in `acts_as_attachable'
59    /usr/share/redmine/app/models/message.rb    23    
60    /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb    36    in `gem_original_require'
61    /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb    36    in `require'
62    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    184    in `require'
63    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    291    in `require_or_load_without_engine_additions'
64    /usr/share/redmine/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb    132    in `require_or_load'
65    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    451    in `load_missing_constant'
66    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    106    in `const_missing'
67    /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb    118    in `const_missing'
68    /usr/lib/ruby/vendor_ruby/active_support/inflector.rb    364    in `constantize'
69    /usr/lib/ruby/vendor_ruby/active_support/inflector.rb    363    in `each'
70    /usr/lib/ruby/vendor_ruby/active_support/inflector.rb    363    in `constantize'
71    /usr/lib/ruby/vendor_ruby/active_support/core_ext/string/inflections.rb    162    in `constantize'
72    /usr/lib/ruby/vendor_ruby/active_record/observer.rb    157    in `observed_class'
73    /usr/lib/ruby/vendor_ruby/active_record/observer.rb    183    in `observed_classes'
74    /usr/lib/ruby/vendor_ruby/active_record/observer.rb    166    in `initialize'
75    /usr/lib/ruby/1.8/singleton.rb    94    in `new'
76    /usr/lib/ruby/1.8/singleton.rb    94    in `instance'
77    /usr/lib/ruby/vendor_ruby/active_record/observer.rb    38    in `instantiate_observers'
78    /usr/lib/ruby/vendor_ruby/active_record/observer.rb    36    in `each'
79    /usr/lib/ruby/vendor_ruby/active_record/observer.rb    36    in `instantiate_observers'
80    /usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb    15    in `define_dispatcher_callbacks'
81    /usr/lib/ruby/vendor_ruby/active_support/callbacks.rb    182    in `call'
82    /usr/lib/ruby/vendor_ruby/active_support/callbacks.rb    182    in `evaluate_method'
83    /usr/lib/ruby/vendor_ruby/active_support/callbacks.rb    166    in `call'
84    /usr/lib/ruby/vendor_ruby/active_support/callbacks.rb    90    in `run'
85    /usr/lib/ruby/vendor_ruby/active_support/callbacks.rb    90    in `each'
86    /usr/lib/ruby/vendor_ruby/active_support/callbacks.rb    90    in `send'
87    /usr/lib/ruby/vendor_ruby/active_support/callbacks.rb    90    in `run'
88    /usr/lib/ruby/vendor_ruby/active_support/callbacks.rb    276    in `run_callbacks'
89    /usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb    51    in `send'
90    /usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb    51    in `run_prepare_callbacks'
91    /usr/share/redmine/vendor/rails/railties/lib/initializer.rb    631    in `prepare_dispatcher'
92    /usr/share/redmine/vendor/rails/railties/lib/initializer.rb    185    in `process'
93    /usr/share/redmine/vendor/rails/railties/lib/initializer.rb    113    in `send'
94    /usr/share/redmine/vendor/rails/railties/lib/initializer.rb    113    in `run'
95    /usr/share/redmine/config/environment.rb    49    
96    /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb    36    in `gem_original_require'
97    /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb    36    in `require'
98    /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb    303    in `preload_application'
99    /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb    252    in `initialize_server'
100    /usr/lib/ruby/1.8/phusion_passenger/utils.rb    255    in `report_app_init_status'
101    /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb    237    in `initialize_server'
102    /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb    194    in `start_synchronously'
103    /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb    163    in `start'
104    /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb    213    in `start'
105    /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb    262    in `spawn_rails_application'
106    /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb    126    in `lookup_or_add'
107    /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb    256    in `spawn_rails_application'
108    /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb    80    in `synchronize'
109    /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb    79    in `synchronize'
110    /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb    255    in `spawn_rails_application'
111    /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb    154    in `spawn_application'
112    /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb    287    in `handle_spawn_application'
113    /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb    352    in `__send__'
114    /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb    352    in `main_loop'
115    /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb    196    in `start_synchronously'
116    /usr/lib/phusion_passenger/passenger-spawn-server    61    

Is there a way to perform a backup and restore. Or fix the problem?


Replies (1)

RE: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) (Mysql::Error) - Added by Jan Niggemann (redmine.org team member) about 11 years ago

Google the error message "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) (Mysql::Error)"...
... and give more details!
Redmine version?
Has it worked before?
If so, what did you change?

    (1-1/1)