mma informatica Posted January 2, 2013 Report Share Posted January 2, 2013 (edited) Esta apresentando um erro e eu estou precisando de ajuda.DELIMITER $$CREATE TRIGGER before_privilegiosBEFORE insert ON usuarioFOR EACH ROW BEGIN SET USUARIO = NEW.nome_usuario; SET SENHA = NEW.senha_usuario; CREATE USER USUARIO@localhost IDENTIFIED BY SENHA; GRANT INSERT ON CONTRATACAO.* TO USUARIO@localhost IDENTIFIED BY SENHA; FLUSH PRIVILEGES;END$$DELIMITER ; Edited January 2, 2013 by Denis Courcy Título fora de padrão Quote Link to comment Share on other sites More sharing options...
0 Denis Courcy Posted January 2, 2013 Report Share Posted January 2, 2013 Que erro esta sendo apresentado? Quote Link to comment Share on other sites More sharing options...
0 mma informatica Posted January 2, 2013 Author Report Share Posted January 2, 2013 Que erro esta sendo apresentado?Que erro esta sendo apresentado?quando eu executo ele apresenta o erro que esta na ultima linha.0 13:59:28 CREATE TRIGGER before_privilegios BEFORE insert ON usuario FOR EACH ROW BEGIN SET USUARIO = NEW.nome_usuario; SET SENHA = NEW.senha_usuario; CREATE USER USUARIO@localhost IDENTIFIED BY SENHA; GRANT INSERT ON CONTRATACAO.* TO USUARIO@localhost IDENTIFIED BY SENHA; FLUSH PRIVILEGES; END Error Code: 1193. Unknown system variable 'USUARIO' Quote Link to comment Share on other sites More sharing options...
0 MatheusRomagna Posted January 14, 2013 Report Share Posted January 14, 2013 Esta indicando a tabela referente a trigger? Quote Link to comment Share on other sites More sharing options...
Question
mma informatica
Esta apresentando um erro e eu estou precisando de ajuda.
DELIMITER $$
CREATE TRIGGER before_privilegios
BEFORE insert ON usuario
FOR EACH ROW BEGIN
SET USUARIO = NEW.nome_usuario;
SET SENHA = NEW.senha_usuario;
CREATE USER USUARIO@localhost IDENTIFIED BY SENHA;
GRANT INSERT ON CONTRATACAO.* TO USUARIO@localhost IDENTIFIED BY SENHA;
FLUSH PRIVILEGES;
END$$
DELIMITER ;
Edited by Denis CourcyTítulo fora de padrão
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.