我想使用mysql中定义的触发器运行python脚本。我正在使用以下内容:
DELIMITER $
CREATE TRIGGER T
AFTER INSERT ON MyTable
FOR EACH ROW
BEGIN
DECLARE cmd CHAR(255);
DECLARE result int(10);
SET cmd = CONCAT('python /home/trigger.py');
SET result = sys_exec(cmd);
END;
$
DELIMITER ;
但似乎mysql无法运行python脚本。我在日志文件中收到以下错误:
[21567.146058] type = 1400 audit(1398864654.174:68):apparmor =“DENIED”operation =“exec”parent = 3054 profile =“/ usr / sbin / mysqld”name =“/ bin / dash”pid = 5011 comm =“mysqld”requested_mask =“x”denied_mask =“x”fsuid = 116 ouid = 0
任何人都可以帮忙吗?
谢谢!