Which Mysql command kills the process if a query takes more than 20s to execute?

Asked

Viewed 6,151 times

1

People would like to know some configuration command in mysql, which kills the process if the query takes more than 30 seconds to return some result exists ? as ?

2 answers

1

To list base processes and only execute the following command:

SHOW PROCESSLIST

The list of processes that are active will be displayed.

To kill the process just check its ID and type:

KILL [numero_do_processo]

Ex:

mysql> KILL 23435

0

You can set up a timeout.

This can be done on the server, on the connection itself, or only for the operation you want to perform.

Set up a timeout 30 seconds, and if there is no response from the query in this interval, an error will be returned. Hence you can treat this error (in your application, for example).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.