Ask Your Question
0

Invalid Database User with remove_default_accounts

asked 2013-11-25 15:32:29 -0500

jfoshee gravatar image

Provisioning a new box with remove_default_accounts enabled fails with the following error:

Error: Parameter name failed on Mysql_user[root@]: Invalid database user root@

The mysql::server block is as follows:

class { "::mysql::server":
      override_options => {
        mysqld => {
            "bind_address"  => "0.0.0.0",
        }
      },
      root_password           => "asdf",
      remove_default_accounts => true,
}

We also have the following blocks:

  • class { "mysql::server::backup"
  • mysql_database { "Foodb"
  • mysql_user { "Foo@%":
  • mysql_grant { "Foo@%/*.*":

Perhaps one of those blocks could be depending on the presence of the default root user? Any other ideas?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-11-25 17:52:21 -0500

jfoshee gravatar image

I have updated the database, user and grant directives to the dictionary style and the issue has been resolved. So my entire file looks like this now:

class MyOrg::mysql {
# Install and configure MySQL
class { "::mysql::server":
    root_password => "asdf",
    remove_default_accounts => true,
    override_options => {
        mysqld => {
            "bind_address"  => "0.0.0.0",
        }
    },
    databases => {
      'FooDB' => {
        ensure  => 'present',
        charset => 'utf8',
      },
    },
    users => {
      'Foo_User@%' => {
        ensure          => 'present',
        password_hash   => mysql_password("asdf"),
      },
    },
    grants => {
      'Foo_User@%/*.*' => {
        ensure      => 'present',
        privileges  => ["all"],
        table       => "*.*",
        user        => "Foo_User@%",
      },
    },
}

# Enable MySQL Backups
class { "mysql::server::backup":
    backupuser      => "vagrant",
    backuppassword  => "asdf",
    backupdir       => "/vagrant/mysql_backup",
}
}
edit flag offensive delete link more

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

Stats

Asked: 2013-11-25 15:32:29 -0500

Seen: 758 times

Last updated: Nov 25 '13