?
Solved

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

Posted on 2006-06-18
3
Medium Priority
?
2,477 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 19

Expert Comment

by:Kim Ryan
ID: 16931672
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
ID: 16931915
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 2000 total points
ID: 16931916
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

764 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