From 049cf6ea733033f138c599f0dfa3810dc055e3c8 Mon Sep 17 00:00:00 2001 From: William Mantly Date: Mon, 1 Jul 2019 00:35:35 -0400 Subject: [PATCH] MySQL syntax error --- metadata.rb | 2 +- recipes/mysql.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/metadata.rb b/metadata.rb index ec41ee3..30d541d 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,7 +4,7 @@ maintainer_email 'you@example.com' license 'All Rights Reserved' description 'Installs/Configures t42-common' long_description 'Installs/Configures t42-common' -version '0.1.10' +version '0.1.11' chef_version '>= 13.0' depends 'nodejs' diff --git a/recipes/mysql.rb b/recipes/mysql.rb index 1b3d90a..c33ae2d 100644 --- a/recipes/mysql.rb +++ b/recipes/mysql.rb @@ -12,8 +12,8 @@ end bash 'Make mysql Database and User' do code <<~EOH 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']}'@'%' IDENTIFIED BY '#{node['db']['password']}';" - 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 "CREATE USER '#{node['db']['user']}'@localhost IDENTIFIED BY '#{node['db']['password']}';" + mysql -h 127.0.0.1 -uroot -p"#{node['db']['root_password']}" -e "GRANT ALL PRIVILEGES ON '#{node['db']['name']}'.* TO '#{node['db']['user']}'@'%';" mysql -h 127.0.0.1 -uroot -p"#{node['db']['root_password']}" -e "FLUSH PRIVILEGES;" EOH