我已在其最新版本(3.30)中下载了 puppetlabs-mysql module,我无法定义root密码。我的操作系统是Ubuntu 14.04.2 LTS
当我尝试跑步时:
class {'::mysql::server':
remove_default_accounts => true,
create_root_user => true,
create_root_my_cnf => true,
root_password => $mysql_server_root_password,
}
我收到以下消息:
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可以正常安装mysql-server,但在尝试定义root密码时失败。此外,未创建/root/.my.cnf文件。我怎么能解决这个问题?
感谢您的帮助!
答案 0 :(得分:2)
您的root
用户已被删除或其权限已被撤销。不幸的是puppet
将能够恢复它。你必须手动完成。因此,您必须以其他用户create mysql
和/或添加正确的privileges来登录root
。如果无效,请按照指南了解如何恢复已删除的root
用户1,2,3。通常,您必须使用mysqld
选项运行skip-grant-tables
。