This is an old post, but I'll respond anyways for posterity. My summer 
intern just ran into this problem.

@pmbuko has the correct solution-- create a database named 'dashboard' and 
make sure that database.yml says 'dashboard' and not something else like 
'dashboard_production'.

 I'll explain why this error happened. This is a common mistake with 
Ruby-based software. If you follow the instructions 
http://docs.puppetlabs.com/dashboard/manual/1.2/bootstrapping.html , it's 
easy to see why.

The instructions at  say to create a database named 'dashboard':

    

CREATE DATABASE dashboard CHARACTER SET utf8;
CREATE USER 'dashboard'@'localhost' IDENTIFIED BY 'my_password';
GRANT ALL PRIVILEGES ON dashboard.* TO 'dashboard'@'localhost';


However, the file `config/database.yml.example` says the database is named 
'dashboard_production':

production:
  database: dashboard_production
  username: dashboard
  password:
  encoding: utf8
  adapter: mysql

If you copy config/database.yml.example to config/database.yml verbatim, 
then the command `rake RAILS_ENV=production db:migrate` will fail because 
it's expecting to find a database named 'dashboard_production'. 

The simplest fix is to create a database named 'dashboard' and update 
database.yml to use that name. A longer, but possibly more correct, 
solution would be to create three databases following the Ruby naming 
convention (dashboard_production , dashboard_development & dashboard_test) 
and grant privileges on all three databases. But that is probably more work 
then necessary for most people, and I suspect that most folks just use a 
single database named 'dashboard'.

-= Stefan

On Friday, July 6, 2012 2:08:53 PM UTC-7, Hai wrote:
>
> followed the instruction for installing dashboard, and created user
>
> mysql -pmy_password -e "CREATE DATABASE dashboard CHARACTER SET 
> utf8;CREATE USER 'dashboard'@'localhost' IDENTIFIED BY 'my_password'; GRANT 
> ALL PRIVILEGES ON dashboard.* TO 'dashboard'@'localhost';"
>
> however, I keep getting access denied error:
>
> # rake RAILS_ENV=production db:migrate
> (in /usr/share/puppet-dashboard)
> rake aborted!
> Access denied for user 'dashboard'@'localhost' to database 
> 'dashboard_production'
>
> (See full trace by running task with --trace)
>
>
> please help!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to