August 1st, 2013, 07:49 AM
-
Run script trigger
Hi,
I want to run a shell script when a new row is added.
i have made this trigger:
drop trigger if exists block_action;
delimiter ;;
CREATE trigger block_action before insert ON data
FOR EACH ROW
Begin
DECLARE result CHAR(255);
set result = sys_exec('/usr/local/snort/script');
END;;
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 ?
Thanks
Abid
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:
Code:
mysql> SELECT sys_exec('touch /tmp/test_mysql');
/Stefan
August 2nd, 2013, 03:02 AM
-
Hi,
Originally Posted by sr
Is the User Defined Function sys_exec() installed on the server?
What happens if you run the function manually with something like:
Code:
mysql> SELECT sys_exec('touch /tmp/test_mysql');
i get this error:
#1415 - Not allowed to return a result set from a trigger