I am trying to set mysql root password from using chef recipe. Below is the code. But i am getting error.
mysql_service 'default' do
port '3306'
version '5.7.24'
initial_root_password 'test@123'
action [:create, :start]
end
NoMethodError: undefined method `mysql_service' for cookbook
I don't use mysql cookbook chef supermarket. Installation steps are included below. How can i do this?
directory '/opt/mysql' do
owner 'root'
group 'root'
mode '0755'
action :create
end
remote_file "/opt/mysql/mysql57-community-release-el7-9.noarch.rpm" do
source "https://dev.mysql.com/get/mysql/mysql57-community-release-el7-9.noarc h.rpm"
end
package 'mysql57-community-release-el7-9.noarch.rpm' do
source '/opt/mysql/mysql57-community-release-el7-9.noarch.rpm'
action :install
end
package 'mysql-server' do
action :install
end
service "mysqld" do
action [ :enable, :start ]
end