This forum is no longer active. Please post your questions to our new community site

MySql Error in RHEL 5

Subscribe to MySql Error in RHEL 5 5 post(s), 2 voice(s)

 
Avatar silentsea657 11 post(s)

Hi. I have installed it under RHEL 5. It has installed successfully but when I issue the ‘ruby script/server’ command and browse to http://localhost:3000/ and then click on ‘About your application environment’, an error displays saying ‘something went wrong’.

And I cannot access mysql too….
bash-3.1$ mysql
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/opt/rubystack-1.5-4/mysql/tmp/mysql.sock’ (2)

Waiting for your help…

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi,
Is the MySQL server running?

# cd /opt/rubystack-(version)
# ./ctlscripts.sh status

You can start it typing the following:

  1. ./ctlscript.sh start mysql

Cheers.

 
Avatar silentsea657 11 post(s)

Hi. Thanks I can access the MySql now.
but after issuing the http://localhost:3000/ then browsing to ‘About your application environment’ displays ‘something going wrong’
and in the terminal the output is like that.

bash-3.1$ ruby script/server webrick
=> Booting WEBrick
=> Rails 2.3.2 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2009-08-28 14:31:43] INFO WEBrick 1.3.1
[2009-08-28 14:31:43] INFO ruby 1.8.7 (2009-04-08) [i686-linux]
[2009-08-28 14:31:53] WARN TCPServer Error: Address already in use – bind(2)
[2009-08-28 14:31:53] INFO WEBrick::HTTPServer#start: pid=3246 port=3000
/!\ FAILSAFE /!\ Fri Aug 28 14:32:18 +0500 2009
Status: 500 Internal Server Error
Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/mysql_adapter.rb:576:in `real_connect’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/mysql_adapter.rb:576:in `connect’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/mysql_adapter.rb:204:in `initialize’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/mysql_adapter.rb:76:in `new’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/mysql_adapter.rb:76:in `mysql_connection’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `send’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `checkout’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `checkout’
/opt/rubystack-1.5-4/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:9:in `cache’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:28:in `call’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/head.rb:9:in `call’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/methodoverride.rb:24:in `call’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/params_parser.rb:15:in `call’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/rewindable_input.rb:25:in `call’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/session/cookie_store.rb:93:in `call’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/reloader.rb:9:in `call’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/failsafe.rb:11:in `call’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in `call’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in `synchronize’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in `call’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:106:in `call’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/rack/static.rb:31:in `call’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:46:in `call’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:40:in `each’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:40:in `call’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/rack/log_tailer.rb:17:in `call’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/content_length.rb:13:in `call’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/handler/webrick.rb:46:in `service’
/opt/rubystack-1.5-4/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service’
/opt/rubystack-1.5-4/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run’
/opt/rubystack-1.5-4/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread’
/opt/rubystack-1.5-4/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start’
/opt/rubystack-1.5-4/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread’
/opt/rubystack-1.5-4/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start’
/opt/rubystack-1.5-4/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each’
/opt/rubystack-1.5-4/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start’
/opt/rubystack-1.5-4/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start’
/opt/rubystack-1.5-4/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/handler/webrick.rb:13:in `run’
/opt/rubystack-1.5-4/ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/commands/server.rb:111
/opt/rubystack-1.5-4/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’
/opt/rubystack-1.5-4/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’
script/server:3

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi,

It seems that the 3000 port is in use. Could you check if you are running any other process?

ps aux | grep ruby

It seems that your application is looking for the MySQL socket at /tmp/mysql.sock. Could you specify the socket in the config/database.yml file? You have an example in the sample application: installation_directory/projects/rubystack/config/database.yml

Cheers.

 
Avatar silentsea657 11 post(s)

Hi. I have specified the socket and now all is working successfully..
Thanks for your support.
Thanks a lot.