Solved

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

Posted on 2006-06-18
3
2,310 Views
Last Modified: 2012-08-14
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!

0
Comment
Question by:Neil2526
  • 2
3 Comments
 
LVL 19

Expert Comment

by:Kim Ryan
Comment Utility
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
 
LVL 30

Expert Comment

by:todd_farmer
Comment Utility
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
 
LVL 30

Accepted Solution

by:
todd_farmer earned 500 total points
Comment Utility
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now