I faced some real issues regarding the execution of some stored procedures using Mysql server. Sometimes, one of my procedures is not executed (or maybe stopped) during an external call (from app) so I'm wondering :

  • Is it possible that Mysql could stop automatically the and kill the process?
  • if is it true, what are the indicators and factors that make Mysql chose its victim?
  • Is there an alternative to set up a list of priority of running queries?


  • it is a general question to define some scenarios when Mysql decide to kill automatically a ps.
    – Yassine LD
    Dec 4, 2016 at 16:17

1 Answer 1


MySQL can kill a connection if it exceeds wait_timeout. (Caution, there are various wait timeout settings.)

InnoDB can kill a transaction in the case of a "deadlock". One of the competing transactions is killed, the other(s) are allowed to continue.

InnoDB can kill a query if it is waiting too long for a lock. See innodb_lock_wait_timeout, which defaults to 50 seconds.

A user can "kill" a mysql process via the commandline tool 'mysql' and it's kill command.

I don't think there is anything special about Stored Procedures, Functions, Events, Triggers -- they are essentially collections of queries that are, in turn, subject to the comments above.

UDFs contain code written by users and specially installed. These can do anything nasty that you like.

There are essentially no "priorities" that you can control. It is better to let MySQL decide what to do when.

Do you mean something else by "process"?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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