[chef] Re: Re: Why I need to set mysql root password MANUAL when using mysql recipes(opscode) in my cookbook?


Chronological Thread 
  • From: Vladimir Skubriev < >
  • To:
  • Subject: [chef] Re: Re: Why I need to set mysql root password MANUAL when using mysql recipes(opscode) in my cookbook?
  • Date: Thu, 24 Oct 2013 08:11:04 +0400

On 10/21/2013 08:56 PM, DV wrote:
" type="cite">
Not sure what's causing this error for you, but here's how I install MySQL in my recipe. I'm using Chef server, not Chef solo.

In my cookbook's metadata.rb:

depends "database"
depends "mysql"


In my cookbook's recipe (note that I didn't put these under any "if" statement):

# Install MySQL

include_recipe "mysql::server"
include_recipe "mysql::client"
include_recipe "database::mysql"

# Create database
mysql_connection_info = {:host => 'localhost', :username => 'root', :password => node[:mysql][:server_root_password]}
mysql_database 'mydb' do
connection mysql_connection_info
action :create
end

# Create tables
mysql_database 'mydb' do
connection mysql_connection_info
sql { ::File.open("#{$mydir}/mytables.sql").read }
action :query
end

# Create user
mysql_database_user 'myuser' do
connection mysql_connection_info
password 'mypass'
action :create
end

# Grant privileges to user
mysql_database_user 'myuser' do
connection mysql_connection_info
password 'mypass'
database_name 'mydb'
host '%'
privileges [:all]
action :grant
end


Hope this helps.


I found the reason why not work.

Thak you this some helps to me )

See my last letters )

-- 
Best regards,

CVision Lab System Administrator
Vladmir Skubriev



Archive powered by MHonArc 2.6.16.

§