Ask Your Question

Cannot seem to assign a password to root

asked 2016-01-20 10:24:54 -0600

Back-N-Black gravatar image

This setup works with no noticeable errors, the mysql database is created and starts. The reason i think there is an issue is that I can login to mysql WITHOUT entering a password.


mysql -u root -p mysql
Enter password:
mysql> show databases;

Am I doing something wrong is this even a puppet/module issue?

I am using these versions of puppetlabs-mysql and it's dependencies in my version 2.7.26 puppet. Note: I have also tried this with PuppetLabs-mysql 2.3.1 * Puppet 2.7.26 * PuppetLabs-mysql 3.6.2 w/showdiff fix * PuppetLabs-stdlib 4.11.0 * nanliu-staging 1.0.3

This is how we implement puppet


import 'nodes.pp'
$puppetserver = 'puppet'


node 'default' {
   include jdk
node 'myhost.domain' inherits 'default' {
   include mysql


class mysql {
   $mysql_root_password = "somepass"
   class { 'mysql::server':
      root_password           => $mysql_root_password
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-01-21 03:36:09 -0600

fvoges gravatar image

The mySQL module adds the password to ~/.my.cnf see the module documentation

edit flag offensive delete link more


Thanks for your response. I am somewhat familiar with the .my.cnf file but in this case I still don't believe its working as expected. It creates the file in / not in root's home directory. roots home is /root. It also does not explain why a non-root user can login with no password.

Back-N-Black gravatar imageBack-N-Black ( 2016-01-21 07:25:42 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-01-20 10:24:54 -0600

Seen: 75 times

Last updated: Jan 21 '16