August 1st, 2013, 07:49 AM
Run script trigger
I want to run a shell script when a new row is added.
i have made this trigger:
drop trigger if exists block_action;
CREATE trigger block_action before insert ON data
FOR EACH ROW
DECLARE result CHAR(255);
set result = sys_exec('/usr/local/snort/script');
I get no error , but i get not the result that i wait from the script, i get nothing.
So what is the problem ? did i made a mistake ?
August 1st, 2013, 08:38 AM
Is the User Defined Function sys_exec() installed on the server?
What happens if you run the function manually with something like:
mysql> SELECT sys_exec('touch /tmp/test_mysql');
August 2nd, 2013, 03:02 AM
i get this error:
#1415 - Not allowed to return a result set from a trigger