Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
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/ 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 2 '11 at 14:18
1  
See also this: github.com/mitchellh/vagrant/pull/370 –  frabcus Aug 2 '11 at 14:19
add comment

1 Answer

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.