Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

When using triggers, if an update is done to a table then a trigger is executed. This is very convenient. But what I would need is to execute an external script.
Is it possible to configure MySQL somehow so on a trigger/change of a value in a table an external process/scrip is executed?

share|improve this question
    
So for every row update, an external application would be called? And if 4000 rows are updated, the application would be launched 4000 times? You think that would be wise? And if you had a million rows updated? –  ypercube Jan 19 at 1:28
    
Even if the update frequency is low, there are several other serious issues with such an approach. See: Catch-22 of the Active Database –  ypercube Jan 19 at 1:39
    
@ypercube:Interesting link.It is based on "triggers fire at the time of the operation, not the time of the commit". I was not aware of that.In this case it seems that triggers are useless in any case –  Jim Jan 19 at 12:51
    
As simple example, I found this blog with an simple example: Call an external program form MySQL Trigger I found this example easy to understand. :) Best regards. –  iVieL Jul 31 at 20:13

1 Answer 1

up vote 1 down vote accepted

It is possible, and it also makes for a security threat.

Anyway, to make that happen you would need to create (program, compile and install plugin) you own UDF - User Defined Function. It's a C/C++ code, so you can do anything you like in there.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.