mysql - 目前 Ubuntu 上的 puppetlabs-mysql 模块有什么技巧吗?

标签 mysql ubuntu puppet vagrant

有一个正在运行的 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/

相关文章:

mysql - 将 puppetdb 转储到 MySql 甚至 postgres 中

php - Laravel created_at、updated_at 和 Id 列 php

mysql - 从多列创建条形图

node.js - Typescript build "Cannot find module",但仅在 ubuntu 服务器上

python - 由于 ubuntu 服务器上的 PYTHONPATH,使用 pip 导入时出错

windows - Windows 下 Puppet/Vagrant 中的颜色编码?

MySql 更新查询太慢(本地主机)

mysql - AWS RDS 可以主从复制吗?

php - 家园:错误! tar解压解压错误

ruby - 在 Centos 6 上安装 Code Deploy Agent