1

When running:

$ sudo puppetd --verbose --no-daemonize -o

I get errors such as:

err: //webserver/Mysql::Rights[Setup SW Database]/Mysql_user[scraperwiki@localhost]: Failed to retrieve current state of resource: Execution of '/usr/bin/mysql mysql -NBe select '1' from user where CONCAT(user, '@', host) = 'scraperwiki@localhost'' returned 1: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
notice: //webserver/Mysql::Rights[Setup SW Database]/Mysql_grant[scraperwiki@localhost/scraperwiki_live]: Dependency mysql_user[scraperwiki@localhost] has 1 failures

And:

err: //webserver/Mysql::Database[SW DB]/Mysql_database[scraperwiki_live]: Failed to retrieve current state of resource: Execution of '/usr/bin/mysql mysql -NBe show databases' returned 1: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Why is it failing to connect to MySQL to even list the databases, when I'm root?

frabcus
  • 204
  • 2
  • 6
  • 2
    Here is my answer - ServerFault won't let me self answer as I'm a new user. Are you using the puppet-mysql plugin/ https://github.com/camptocamp/puppet-mysql If so, firstly, check you have a file /root/.my.cnf with the root mysql user password in it. This should have been made by the plugin. The problem is the plugin isn't finding that file when doing basic things like listing existing databases. Running the command like this will work, to help it find it: $ HOME=/root sudo puppetd --verbose --no-daemonize -o I'm not sure how you are meant to do it. – frabcus Aug 02 '11 at 14:18
  • 1
    See also this: https://github.com/mitchellh/vagrant/pull/370 – frabcus Aug 02 '11 at 14:19

1 Answers1

1

The problem is currently tracked at http://projects.puppetlabs.com/issues/16262

It even has a proper workaround in the puppetlabs-mysql module — but as far as I know, it's not released yet.

alf
  • 111
  • 3