Changing MySQL user

This commit is contained in:
Axel 2020-12-29 13:35:27 +01:00
parent b70a93f595
commit 388d25652f

View file

@ -147,7 +147,7 @@ package 'mariadb-client'
service 'mysql' do service 'mysql' do
action [:enable, :start] action [:enable]
end end
template '/etc/init.d/mysql' do template '/etc/init.d/mysql' do
@ -158,6 +158,11 @@ template '/etc/mysql/mariadb.conf.d/50-server.cnf' do
source 'mysql-50-server.cnf' source 'mysql-50-server.cnf'
end end
execute 'mysql_change_user' do
user 'root'
command: '/bin/sed -i 's/^\(user\s*=\s*\).*$/\1vagrant/' /etc/mysql/my.cnf'
end
directory '/var/run/mysqld' do directory '/var/run/mysqld' do
user 'root' user 'root'
action :create action :create