Luca Gioppo
2012-Sep-06 08:15 UTC
[Puppet Users] puppetlsabs/puppet-mysql error: access denied for user root
On a second run of puppet after adding the mysql::db is not possible to create the db getting the error below class { ''mysql::server'': config_hash => {root_password => ''changeme'',} } mysql::db { ''mydatabase'': user => ''myapp1'', password => ''supersecret'', host => ''webapp1.puppetlabs.com'', } Error: Execution of ''/usr/bin/mysql -NBe create database `mydatabase` character set utf8'' returned 1: ERROR 1045 (28000): Access denied for user ''root''@''localhost'' (using password: NO) Executing the command from shell (after replacing the quotes ` with '' ) and including all the command in double quote the db gets created. It seems that the puppet process cannot find the password that is present in the /root/.my.conf For sure there is some problem in my installation any help? Thanks Luca -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/acyvqiM8R_YJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Luca Gioppo
2012-Sep-06 13:15 UTC
[Puppet Users] Re: puppetlsabs/puppet-mysql error: access denied for user root
Ok problem solved Evidently pupped uses the /etc/my.cfg to get the password to access to the DB This info is not written down in the puppet-mysql template (I believe that few people use the database creation of the module). Also there is a bit of mess right now on the writing of that file it seems that it get written by too many pieces. In the end is possible to add the password key in that file and all goes well. As a workaround this can be a good solution, but for long term approach I think that writing down in clear in the host the root passowrd is not a good approach, but anyway... Thanks Luca Il giorno giovedì 6 settembre 2012 10:15:38 UTC+2, Luca Gioppo ha scritto:> > On a second run of puppet after adding the mysql::db is not possible to > create the db getting the error below > > class { ''mysql::server'': > config_hash => {root_password => ''changeme'',} > } > mysql::db { ''mydatabase'': > user => ''myapp1'', > password => ''supersecret'', > host => ''webapp1.puppetlabs.com'', > } > > Error: Execution of ''/usr/bin/mysql -NBe create database `mydatabase` > character set utf8'' returned 1: ERROR 1045 (28000): Access denied for user > ''root''@''localhost'' (using password: NO) > > Executing the command from shell (after replacing the quotes ` with '' ) > and including all the command in double quote the db gets created. > It seems that the puppet process cannot find the password that is present > in the /root/.my.conf > > For sure there is some problem in my installation any help? > Thanks > Luca >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/zZzw5IGBF0IJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Erik Dalén
2012-Sep-06 13:24 UTC
Re: [Puppet Users] Re: puppetlsabs/puppet-mysql error: access denied for user root
It is probably because $HOME isn''t set properly when it is running as an agent. There is an open pull request to fix this: https://github.com/puppetlabs/puppetlabs-mysql/pull/92 On 6 September 2012 15:15, Luca Gioppo <lucagioppo@gmail.com> wrote:> Ok problem solved > Evidently pupped uses the /etc/my.cfg to get the password to access to the > DB > This info is not written down in the puppet-mysql template (I believe that > few people use the database creation of the module). > Also there is a bit of mess right now on the writing of that file it seems > that it get written by too many pieces. > In the end is possible to add the password key in that file and all goes > well. > As a workaround this can be a good solution, but for long term approach I > think that writing down in clear in the host the root passowrd is not a good > approach, but anyway... > Thanks > Luca > > Il giorno giovedì 6 settembre 2012 10:15:38 UTC+2, Luca Gioppo ha scritto: >> >> On a second run of puppet after adding the mysql::db is not possible to >> create the db getting the error below >> >> class { ''mysql::server'': >> config_hash => {root_password => ''changeme'',} >> } >> mysql::db { ''mydatabase'': >> user => ''myapp1'', >> password => ''supersecret'', >> host => ''webapp1.puppetlabs.com'', >> } >> >> Error: Execution of ''/usr/bin/mysql -NBe create database `mydatabase` >> character set utf8'' returned 1: ERROR 1045 (28000): Access denied for user >> ''root''@''localhost'' (using password: NO) >> >> Executing the command from shell (after replacing the quotes ` with '' ) >> and including all the command in double quote the db gets created. >> It seems that the puppet process cannot find the password that is present >> in the /root/.my.conf >> >> For sure there is some problem in my installation any help? >> Thanks >> Luca > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-users/-/zZzw5IGBF0IJ. > > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en.-- Erik Dalén -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.