MySQL permission issue #14

Merged
wmantly merged 1 commits from mysql into master 2019-07-01 04:16:31 +00:00
2 changed files with 7 additions and 7 deletions
Showing only changes of commit cbfb990ab0 - Show all commits

View File

@ -4,7 +4,7 @@ maintainer_email 'you@example.com'
license 'All Rights Reserved' license 'All Rights Reserved'
description 'Installs/Configures t42-common' description 'Installs/Configures t42-common'
long_description 'Installs/Configures t42-common' long_description 'Installs/Configures t42-common'
version '0.1.8' version '0.1.9'
chef_version '>= 13.0' chef_version '>= 13.0'
depends 'nodejs' depends 'nodejs'

View File

@ -1,7 +1,7 @@
mysql_service node['db']['name'] do mysql_service node['app']['name'] do
# version '5.7' # version '5.7'
bind_address '127.0.0.1' bind_address node['db']['bind_address']
port '3306' port ['db']['port']
# data_dir '/data' # data_dir '/data'
initial_root_password node['db']['root_password'] initial_root_password node['db']['root_password']
@ -11,9 +11,9 @@ end
bash 'Make mysql Database and User' do bash 'Make mysql Database and User' do
code <<~EOH code <<~EOH
mysql -h 127.0.0.1 -uroot -p"#{node['db']['root_password']}" -e "CREATE DATABASE #{node['db']['user']} /*\!40100 DEFAULT CHARACTER SET utf8 */;" mysql -h 127.0.0.1 -uroot -p"#{node['db']['root_password']}" -e "CREATE DATABASE #{node['db']['name']} /*\!40100 DEFAULT CHARACTER SET utf8 */;"
mysql -h 127.0.0.1 -uroot -p"#{node['db']['root_password']}" -e "CREATE USER #{node['db']['user']}@localhost IDENTIFIED BY '#{node['db']['password']}';" mysql -h 127.0.0.1 -uroot -p"#{node['db']['root_password']}" -e "CREATE USER #{node['db']['user']}@'%' IDENTIFIED BY '#{node['db']['password']}';"
mysql -h 127.0.0.1 -uroot -p"#{node['db']['root_password']}" -e "GRANT ALL PRIVILEGES ON #{node['db']['user']}.* TO '#{node['db']['user']}'@'localhost';" mysql -h 127.0.0.1 -uroot -p"#{node['db']['root_password']}" -e "GRANT ALL PRIVILEGES ON #{node['db']['name']}.* TO '#{node['db']['user']}'@'localhost';"
mysql -h 127.0.0.1 -uroot -p"#{node['db']['root_password']}" -e "FLUSH PRIVILEGES;" mysql -h 127.0.0.1 -uroot -p"#{node['db']['root_password']}" -e "FLUSH PRIVILEGES;"
EOH EOH