Project

General

Profile

Connecting Remote Database Issue

Added by kishore kumar over 10 years ago

Hi Experts,

I am trying to Install redmine on centos 6.5 with the help of http://www.raymondchen.com/?p=895

My database.yml is
production:
adapter: mysql2
database: redmine
host: x.x.x.x (remote host IP)
username: redmine
password: "my_password"
encoding: utf8

but when I ran # RAILS_ENV=production rake db:migrate --trace, the result is

  1. RAILS_ENV=production rake db:migrate --trace
    (in /var/www/redmine-2.5.1)
    • Invoke db:migrate (first_time)
    • Invoke environment (first_time)
    • Execute environment
      rake aborted!
      Access denied for user 'redmine'@'portal1' (using password: YES)
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/mysql2-0.3.15/lib/mysql2/client.rb:67:in `connect'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/mysql2-0.3.15/lib/mysql2/client.rb:67:in `initialize'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activerecord-3.2.17/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activerecord-3.2.17/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
      /usr/local/rvm/rubies/ruby-1.9.3-p545/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
      /usr/local/rvm/rubies/ruby-1.9.3-p545/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activerecord-3.2.17/lib/active_record/model_schema.rb:224:in `table_exists?'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activerecord-3.2.17/lib/active_record/attribute_methods/primary_key.rb:75:in `get_primary_key'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activerecord-3.2.17/lib/active_record/attribute_methods/primary_key.rb:60:in `reset_primary_key'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activerecord-3.2.17/lib/active_record/attribute_methods/primary_key.rb:49:in `primary_key'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activerecord-3.2.17/lib/active_record/attribute_assignment.rb:13:in `attributes_protected_by_default'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activemodel-3.2.17/lib/active_model/mass_assignment_security.rb:216:in `block in protected_attributes_configs'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activemodel-3.2.17/lib/active_model/mass_assignment_security.rb:188:in `yield'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activemodel-3.2.17/lib/active_model/mass_assignment_security.rb:188:in `default'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activemodel-3.2.17/lib/active_model/mass_assignment_security.rb:188:in `protected_attributes'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activemodel-3.2.17/lib/active_model/mass_assignment_security.rb:118:in `block in attr_protected'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activemodel-3.2.17/lib/active_model/mass_assignment_security.rb:117:in `each'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activemodel-3.2.17/lib/active_model/mass_assignment_security.rb:117:in `attr_protected'
      /var/www/redmine-2.5.1/app/models/issue_relation.rb:73:in `<class:Issudebug2: channel 0: window 996204 sent adjust 52372
      eRelation>'
      /var/www/redmine-2.5.1/app/models/issue_relation.rb:18:in `<top (required)>'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `require'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `block in require'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:236:in `load_dependency'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `require'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:359:in `require_or_load'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:502:in `load_missing_constant'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:192:in `block in const_missing'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:190:in `each'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:190:in `const_missing'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:514:in `load_missing_constant'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:192:in `block in const_missing'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:190:in `each'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:190:in `const_missing'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:514:in `load_missing_constant'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:192:in `block in const_missing'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:190:in `each'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:190:in `const_missing'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:514:in `load_missing_constant'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:192:in `block in const_missing'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:190:in `each'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:190:in `const_missing'
      /var/www/redmine-2.5.1/lib/redmine/helpers/gantt.rb:28:in `<class:Gantt>'
      /var/www/redmine-2.5.1/lib/redmine/helpers/gantt.rb:21:in `<module:Helpers>'
      /var/www/redmine-2.5.1/lib/redmine/helpers/gantt.rb:19:in `<module:Redmine>'
      /var/www/redmine-2.5.1/lib/redmine/helpers/gantt.rb:18:in `<top (required)>'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `require'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `block in require'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:236:in `load_dependency'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `require'
      /var/www/redmine-2.5.1/lib/redmine.rb:56:in `<top (required)>'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `require'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `block in require'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:236:in `load_dependency'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `require'
      /var/www/redmine-2.5.1/config/initializers/30-redmine.rb:4:in `<top (required)>'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:245:in `load'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:245:in `block in load'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:236:in `load_dependency'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:245:in `load'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/railties-3.2.17/lib/rails/engine.rb:593:in `block (2 levels) in <class:Engine>'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/railties-3.2.17/lib/rails/engine.rb:592:in `each'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/railties-3.2.17/lib/rails/engine.rb:592:in `block in <class:Engine>'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/railties-3.2.17/lib/rails/initializable.rb:30:in `instance_exec'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/railties-3.2.17/lib/rails/initializable.rb:30:in `run'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/railties-3.2.17/lib/rails/initializable.rb:55:in `block in run_initializers'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/railties-3.2.17/lib/rails/initializable.rb:54:in `each'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/railties-3.2.17/lib/rails/initializable.rb:54:in `run_initializers'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/railties-3.2.17/lib/rails/application.rb:136:in `initialize!'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/railties-3.2.17/lib/rails/railtie/configurable.rb:30:in `method_missing'
      /var/www/redmine-2.5.1/config/environment.rb:14:in `<top (required)>'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `require'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `block in require'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:236:in `load_dependency'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `require'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/railties-3.2.17/lib/rails/application.rb:103:in `require_environment!'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/railties-3.2.17/lib/rails/application.rb:305:in `block (2 levels) in initialize_tasks'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
      /usr/local/rvm/rubies/ruby-1.9.3-p545/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/lib/rake/task.rb:197:in `block in invoke_prerequisites'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/lib/rake/task.rb:195:in `each'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/lib/rake/task.rb:195:in `invoke_prerequisites'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/lib/rake/task.rb:174:in `block in invoke_with_call_chain'
      /usr/local/rvm/rubies/ruby-1.9.3-p545/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/lib/rake/application.rb:149:in `invoke_task'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/lib/rake/application.rb:106:in `block (2 levels) in top_level'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/lib/rake/application.rb:106:in `each'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/lib/rake/application.rb:106:in `block in top_level'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/lib/rake/application.rb:115:in `run_with_threads'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/lib/rake/application.rb:100:in `top_level'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/lib/rake/application.rb:78:in `block in run'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
      /usr/local/rvm/gems/ruby-1.9.3-p545/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
      /usr/local/rvm/gems/ruby-1.9.3-p545/bin/rake:23:in `load'
      /usr/local/rvm/gems/ruby-1.9.3-p545/bin/rake:23:in `<main>'
      /usr/local/rvm/gems/ruby-1.9.3-p545/bin/ruby_executable_hooks:15:in `eval'
      /usr/local/rvm/gems/ruby-1.9.3-p545/bin/ruby_executable_hooks:15:in `<main>'
      Tasks: TOP => db:migrate => environment

Why its trying to connect localhost (portal1) ? is there is a different way to mention remote database to connect ?

Please help me to get rid from this

Thanks,
Kishore.


Replies (4)

RE: Connecting Remote Database Issue - Added by kishore kumar over 10 years ago

Is this the right place to post this question?

Thanks,
Kishore.

RE: Connecting Remote Database Issue - Added by Jan Niggemann (redmine.org team member) over 10 years ago

Access denied for user 'redmine'@'portal1' (using password: YES)
Why its trying to connect localhost (portal1) ? is there is a different way to mention remote database to connect ?

The database connection is configured in the database.yml file.

RE: Connecting Remote Database Issue - Added by Rupesh Helwade over 10 years ago

Not sure but see /etc/hosts entries

RE: Connecting Remote Database Issue - Added by Martin Denizet (redmine.org team member) over 10 years ago

Rupesh Helwade wrote:

Not sure but see /etc/hosts entries

Should not be that because he specified that he is using the IP.

I suggest you to test the connection on the server using the mysql command:

mysql --host=<IP> -uredmine -pmy_password redmine

See mysql man page.

If it doesn't work, the problem is not related to Redmine.

Cheers,

    (1-4/4)