dataset/seed/applicationservice/2022.03.08/mariadb/templates/mariadb.sql

9 lines
394 B
MySQL
Raw Normal View History

2022-03-08 19:42:28 +01:00
%for %%server in %%accounts.remotes
%set %%name = %%normalize_family(%%server)
%set %%password = %%accounts['remote_' + %%name]['password_' + %%name]
CREATE USER IF NOT EXISTS '%%name'@'%%server' IDENTIFIED BY '%%password';
CREATE DATABASE IF NOT EXISTS %%name CHARACTER SET utf8;
GRANT ALL PRIVILEGES ON %%name.* TO '%%name'@'%%server' IDENTIFIED BY '%%password';
FLUSH PRIVILEGES;
%end for