有一个正在运行的 github 线程(似乎已关闭并且已完成大量提交/合并)。
尽管 VirtualBox 和 Vagrant 还不到 2 周:*编辑:我仍然看到与/root/.my.cnf 相关的错误。
我更新了 mysql 和 stdlib 模块以掌握。
# MySQL Server
class { 'mysql::server':
config_hash => {
'root_password' => 'foobah'
}
}
#class { 'mysql::server': } have tried it like this to try not having a root password. But it still attempted to use the /root/.my.cnf file.
mysql::db { 'data_base':
user => 'user',
password => 'pass',
host => 'localhost',
grant => ['all'],
charset => 'utf8',
}
每当它以 root 身份执行创建数据库等命令时,我都会得到:
err: /Stage[main]//Mysql::Db[data_base]/Database[data_base]/ensure: change from absent to present failed: Execution of '/usr/bin/mysql --defaults-file=/root/.my.cnf -NBe create database `data_base` character set utf8' returned 1: Could not open required defaults file: /root/.my.cnf
Fatal error in defaults handling. Program aborted
最佳答案
是的,这是一个排序问题(在开发我自己的(工作)Ubuntu mysql list 后,我更清楚要寻找什么)。
所需的 mysql::db 部分:
require => File['/root/.my.cnf'],
修订并添加内容:
# MySQL Server
class { 'mysql::server':
config_hash => {
'root_password' => 'foobah'
}
}
mysql::db { 'data_base':
user => 'user',
password => 'pass',
host => 'localhost',
grant => ['all'],
charset => 'utf8',
require => File['/root/.my.cnf'],
}
关于mysql - 目前 Ubuntu 上的 puppetlabs-mysql 模块有什么技巧吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14135745/