(not all details should be relevant; however writing all valuable information on database might help with the solution) I am trying to write a mariaDB database on manjaro where there is a table that upon the addition of a row it will add a user with details according to that row, and upon deletion will remove said user.
DELIMITER $$
$$
CREATE TRIGGER user_creation
AFTER INSERT ON Users FOR EACH ROW
BEGIN
DECLARE username CHAR(100);
DECLARE password_hash CHAR(100);
SELECT NEW.user_name INTO username;
SELECT NEW.hash INTO password_hash;
CREATE USER username@'%' IDENTIFIED BY password_hash [AS 'auth_string'];
GRANT SELECT TO username@'%';
END;$$
DELIMITER ;
I looked through the results for this question because it seemed right for me but I couldn't get it to work.
ORACLE PLSQL Create user with trigger identified by :new username and password