Project

General

Profile

Rake db:migrate error during installation.

Added by Joseph DelCioppio over 15 years ago

Guys,

Trying to install redmine and trying to prevent myself from having to use the "root" login when I access the database.

With that in mine I created a "redmine" @ "localhost" user in mysql, a "redmine" database, gave user "redmine" r/w privileges to the "redmine" datbase and set up my config/database.yml file as follows.

production:
  adapter: mysql
  database: redmine
  host: localhost
  username: redmine
  password: y1Uv0X9x
  encoding: utf8

However, when I run "rake db:migrate RAILS_ENV="production" I get the following error with the following trace:


joseph@Chopper:~/redmine-0.8$ rake db:migrate RAILS_ENV="production" --trace
(in /home/joseph/redmine-0.8)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
rake aborted!
Access denied for user 'redmine'@'localhost' (using password: YES)
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/mysql_adapter.rb:527:in `real_connect'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/mysql_adapter.rb:527:in `connect'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/mysql_adapter.rb:186:in `initialize'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/mysql_adapter.rb:85:in `new'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/mysql_adapter.rb:85:in `mysql_connection'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:292:in `send'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:292:in `connection='
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:260:in `retrieve_connection'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in `connection'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/migration.rb:408:in `initialize'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/migration.rb:373:in `new'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/migration.rb:373:in `up'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.2/lib/active_record/migration.rb:356:in `migrate'
/usr/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/tasks/databases.rake:99
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19 

I am fairly sure that this is a permissions issue with the "redmine" user in mysql, since I also get the same error if I try to log in to the mysqlclient like this:

joseph@Chopper:~/redmine-0.8$ mysql -u redmine -p
Enter password:
ERROR 1045 (28000): Access denied for user 'redmine'@'localhost' (using password: YES)

Can anybody help me get these permissions correct?

Thanks,

Joe