Ask Your Question
0

Invalid parameter charset on Mysql_database

asked 2016-06-15 10:41:30 -0500

I've installed puppet 3 on a CentOS 6 server and then installed the puppetlabs-stdlib and puppetlabs-puppet modules. I've not modified these at all.

In my manifest, I've taken the examples to create a database called 'puppet':

class { '::mysql::server': root_password => '8WQAx99e', remove_default_accounts => true, override_options => $override_options }

mysql::db { 'puppet': user => 'puppet', password => 'Dr8G3rWN', host => 'localhost', grant => ['SELECT', 'UPDATE'] }

But before the module installs the packages I get the following error:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid parameter charset on Mysql_database[puppet] on node puppetmaster.example.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Any help would be greatly appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-06-16 00:44:14 -0500

Gabor gravatar image

Hello!

You can use 'charset' attribute in mysql::db define,

mysql::db { 
    'puppet': 
        user     => 'puppet', 
        password => 'Dr8G3rWN', 
        host     => 'localhost', 
        grant    => ['SELECT', 'UPDATE'],
        charset  => 'utf8',
}

BUT! If you don't set this attribute, module default set to UTF-8.

And this password format invalid. MySQL module cannot convert directly to hashed password. Please, use this query:

SELECT PASSWORD('mypass');

and the returned value copy to password attribute.

OR you can use module function:

mysql::db { 
    'puppet': 
        user     => 'puppet', 
        password => password_hash('Dr8G3rWN'), 
        host     => 'localhost', 
        grant    => ['SELECT', 'UPDATE'],
        charset  => 'utf8',
}
edit flag offensive delete link more

Comments

The module documentation says you can use plain text or hash, but I've tried both. Using the code you've given me where the charset is being set, I get the same error. As you said I'd have thought the charset would be set as a default. Think I'm going to have to raise a bug on their JIRA system.

KakersUK gravatar imageKakersUK ( 2016-06-16 03:31:51 -0500 )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

Stats

Asked: 2016-06-15 10:41:30 -0500

Seen: 38 times

Last updated: Jun 16 '16