I have downloaded puppetlabs-mysql module in its latest version (3.30) and I can not define root password. My OS is Ubuntu 14.04.2 LTS
When I try to run:
class {'::mysql::server':
remove_default_accounts => true,
create_root_user => true,
create_root_my_cnf => true,
root_password => $mysql_server_root_password,
}
I get the following message:
Notice: Compiled catalog for joseguilherme-virtualbox in environment production in 0.53 seconds
Notice: /Stage[main]/Mysql::Server::Install/Package[mysql-server]/ensure: ensure changed 'purged' to 'present'
Notice: /Stage[main]/Mysql::Server::Config/File[mysql-config-file]/content: content changed '{md5}77f15d6c87f9c136c4efcda072017f71' to '{md5}790c6c49aed83ee9b81fa3c7360898c8'
Notice: /Stage[main]/Mysql::Server::Service/File[/var/log/mysql/error.log]/group: group changed 'adm' to 'mysql'
Error: Could not prefetch mysql_user provider 'mysql': Execution of '/usr/bin/mysql -NBe SELECT CONCAT(User, '@',Host) AS User FROM mysql.user' returned 1: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Error: Execution of '/usr/bin/mysql -e CREATE USER 'root'@'localhost' IDENTIFIED BY PASSWORD '*0646FA81148FBF3DB9D94E1F0FF3DDF1407A6A68'' returned 1: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Error: /Stage[main]/Mysql::Server::Root_password/Mysql_user[root@localhost]/ensure: change from absent to present failed: Execution of '/usr/bin/mysql -e CREATE USER 'root'@'localhost' IDENTIFIED BY PASSWORD '*0646FA81148FBF3DB9D94E1F0FF3DDF1407A6A68'' returned 1: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Puppet can install mysql-server normally but it fails when tries to define root password. Also, the /root/.my.cnf file is not created. How could I solve this problem?
Appreciate your help!
Your
root
user was removed or his privileges were revoked. Unfortunatelypuppet
will be able to restore it. You will have to do it manually. So you will have to login tomysql
as a different user, createroot
and/or add proper privileges. If it will not work, please to follow the guides how to restore deletedroot
user 1, 2, 3. Generally you will have to runmysqld
withskip-grant-tables
option.