- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试创建一个说明书包装器来使用 Chef 部署 MySQL,但它似乎没有插入我在说明书中设置的初始 root 密码。
mysql_client 'default' do
version '5.6'
action :create
end
if node['kaltiot_mysql']['deployServer'] == 'true'
#-------------------------------------------
# Create the database server and start it
#-------------------------------------------
mysql_service 'default' do
port '3306'
version '5.6'
initial_root_password node['mysql']['initial_root_password']
action [:create, :start]
end
#-------------------------------------------
# Create the database and the user to access
#-------------------------------------------
include_recipe 'database::mysql'
connection_params = {
:host => 'localhost',
:username => 'root',
:password => node['mysql']['initial_root_password']
}
mysql_database 'test' do
connection connection_params
action :create
end
mysql_database_user 'usertest' do
connection connection_params
password node['mysql']['initial_root_password']
privileges [:all]
action [:create, :grant]
end
end
我的环境如下:
我使用的 Recipe 是最新版本:
由于未设置初始密码,导致数据库部分失败,无法访问数据库。
shell 上的日志如下:
* bash[default :create initialize mysql database] action run[2015-01-16T10:03:03+00:00] INFO: Processing bash[default :create initialize mysql database] action run (/tmp/kitchen/cache/cookbooks/mysql/libraries/provider_mysql_service.rb line 143)
Installing MySQL system tables... 2015-01-16 10:03:03 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
OK
Filling help tables...
2015-01-16 10:03:06 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h default-centos-66.vagrantup.com password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
Please report any problems at http://bugs.mysql.com/
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings
[2015-01-16T10:03:08+00:00] INFO: bash[default :create initialize mysql database] ran successfully
- execute "bash" "/tmp/chef-script20150116-2184-1tou5sq"
* bash[default :create initial records] action nothing[2015-01-16T10:03:08+00:00] INFO: Processing bash[default :create initial records] action nothing (/tmp/kitchen/cache/cookbooks/mysql/libraries/provider_mysql_service.rb line 152)
(skipped due to action :nothing)
[2015-01-16T10:03:08+00:00] INFO: bash[default :create initialize mysql database] sending run action to bash[default :create initial records] (delayed)
* bash[default :create initial records] action run[2015-01-16T10:03:08+00:00] INFO: Processing bash[default :create initial records] action run (/tmp/kitchen/cache/cookbooks/mysql/libraries/provider_mysql_service.rb line 152)
150116 10:03:08 mysqld_safe Logging to '/var/log/mysql-default/error.log'.
150116 10:03:08 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql-default
150116 10:03:12 mysqld_safe mysqld from pid file /var/run/mysql-default/mysqld.pid ended
[2015-01-16T10:03:12+00:00] INFO: bash[default :create initial records] ran successfully
- execute "bash" "/tmp/chef-script20150116-2184-gjywc9"
任何人都可以提供一些线索,为什么它没有设置初始密码?
提前致谢,-恩里克
最佳答案
...看来您没有看过 mysql Recipe 自述文件:引自:
Usage
Place a dependency on the mysql cookbook in your cookbook's metadata.rb
depends 'mysql', '~> 6.0' Then, in a recipe:
mysql_service 'default' do
port '3306'
version '5.5'
initial_root_password 'change me'
action [:create, :start]
end
mysql_config 'default' do
source 'mysite.cnf.erb'
notifies :restart, 'mysql_service[default]'
action :create
end
mysql_service
资源最终导致 mysql 停止,假设会有一个 mysql_config
资源,之后将重新启动该服务。
关于mysql Chef Cookbook 忽略我的初始 root 密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27980777/
我在我的实验室中通过终端使用 ROOT,我们经常收集数据并且每小时都有一个文件夹,其中包含微小的 .root 文件。 我正在尝试创建一个每日 .root 文件,其中包含某一天获取的所有数据,目前我有许
我正在创建一些 Docker 镜像,并且正在阅读其他人是如何做到这一点的。当涉及到在容器内运行进程的用户时,我已经确定了三种一般模式: 它使用 root 用户 处理一切(在 root 下运行的容器内生
使用此命令设置密码后: mysqladmin.exe --user=root password 我在“根”用户的用户表中看到 3 行: http://i.stack.imgur.com/Y4Rkd.
我有这个秒表,我试图在计数达到 0 后重置它。但是我在使用“after_cancel”功能时遇到了问题。谁能帮忙? 发生的是它无休止地继续,我想杀死“之后”功能。 def countdown(self
if(file_exists( $_SERVER['DOCUMENT_ROOT'] . "/index.html")) echo '文件存在'; 当文件的所有者和组设置为 root:root 时,仅返
我尝试在 AWS 和 Google Drive 上的 Redhat 7 上安装 MySQL,但是在安装 mysql-server 5.7 后,我收到了相同的错误。 [root@localhost ~]
我试图仅将根域(而不是其子文件夹)重定向到另一个 URL,而不更改地址。我正在使用 .htaccess 并使用 [P] 标志进行重定向,这适用于子目录但不适用于根目录。 编写以下 .htaccess
我正在使用 Apache CGI mod 来允许通过 HTTP(S) 请求执行 python 脚本。问题是我想要执行的脚本 backup.py 在某个时刻执行一个子进程调用,其中 mysqldump
我有一个 script.sh 文件执行以下命令: chown -R apache:apache /var/www/html/my/data 如果我尝试使用非 root 用户(用户名 = marco)执
我目前正在开发一款可以在开车时读出短信/电子邮件的应用程序。许多用户希望支持 WhatsApp/KakaoTalk。 但是,由于没有“官方”方式来接收他们的消息,因此只有三个选项,都需要 root:
我已经看到这个问题问了几次,但从未得到完全回答(我能找到)。 需要说明的是,我的手机已 root。 我需要做的是在 root 拥有的目录下读取和写入文件,例如 /data。我知道我需要使用 super
我有一个 Google Compute Engine VM 实例,上面运行着 Asterisk Server。当我尝试运行 sudo 时收到此消息: sudo: parse error in /etc
我正在使用sail 并尝试以root 身份使用shell,这是不可能的。 切换到 root 用户要求输入密码,我不知道。 我尝试更改 dockerfile: ARG WWWROOTGROUP RUN
rvm 的全部意义在于能够安装多个 ruby 并从用户帐户访问它们。当您需要从 root 访问任何这些 ruby 时,您会怎么做?或者使用安装在其中一个 rvms 中的 gems? 有没有一种优雅的(
我正在尝试在 Openshift 中运行 SonarQube pod,但它似乎正在以 root 作为所有者安装持久卷。 我们如何将其更改为非 root 用户? 我用“hostPath”创建了我的持久卷
我是 Ansible 的新手,我已经创建了我的第一个 Ansible 角色剧本,当我尝试运行它时,它抛出了下面的错误,而角色之外的其他模块(如处理程序、模板)工作正常。我仅通过剧本中的角色观察到这个问
对“以非 root 用户和 root 用户身份运行 docker”感到困惑。 第一个问题(以非root用户运行):基于Post-installation steps for Linux ,要以非 ro
在我的项目中,我发现需要以分层方式打破我的聚合,使用顶级根级别聚合,以确保根级别的规则一致性,然后我的根下的对象可以分组为各种聚合。在计算根级聚合的完整性时,根验证自己的规则,然后委托(delegat
我不知道我是怎么做到的,但在过去几天的某个时候,我设法将我的 MAMP Pro 用户名和密码更改为 root:root 以外的其他名称。我一直在本地开发 Wordpress 版本,所以它一定是我当时做
update user set host='%' where user='root 之后,我失去了我的 MySQL root 用户的一些权限。所以我停止了服务器并用 --skip-grant-tabl
我是一名优秀的程序员,十分优秀!