问题
I am using phpmyadmin. I am using a trigger in mysql which calls a php script after inserting something in a table. My trigger contains this.
DECLARE result INT;
SET result=(select sys_exec('C:/xampp/php/php.exe C:/xampp/htdocs/mysite/hello.php'));
But i got this error while trying to insert something to the table.
#1305 FUNCTION db.sys_exec does not exists
(my database name is db) Help me with this.Thanks.
回答1:
sys_exec
is not a standard mysql function. It's provided by an external UDF plugin, and must be installed separately: https://github.com/mysqludf/lib_mysqludf_sys#readme
回答2:
In Linux Ubuntu system and few other distributions, mysql server package contains apparmor which limits UDF functions.
Stop apparmor
sudo service apparmor stop
Check apparmor status
sudo service apparmor status
Even then if you get the same error, restart mysql service
Restart mysql
sudo service mysql restart
来源:https://stackoverflow.com/questions/24433851/mysql-error-1305-function-db-sys-exec-does-not-exists