MySQL trigger - can I have it execute a shell script on the system

I need MySQL to execute a SHELL script (not a sql script) on the system when a trigger is "fired". Is this possible? And if so, please...tell me how!

Neil2526Asked:
Who is Participating?
 
todd_farmerConnect With a Mentor Commented:
0
 
Kim RyanIT ConsultantCommented:
A trigger event can only be an insert, update or delete statement. AFAIK it cannot invoke with external processses.

If you need to interact with the system outside of the SQL domain, I would suggest some type of script (Perl,PHP etc). From here you can do all your normal program and system type functions, plus database interaction.
0
 
todd_farmerCommented:
I would imagine it is possible if you were to write a User Defined Function in C/C++ and called it from the trigger.  In terms of MySQL itself providing native functions to invoke a shell script (regardless of whether you want to execute inside the context of a trigger or not), there is no such functionality.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.