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

1

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

    
asked by anonymous 18.04.2016 / 19:48

2 answers

1

To list the processes of the base and only execute the following command:

SHOW PROCESSLIST

The list of processes that are active will be displayed.

To kill the process just check the ID of the process and type:

KILL [numero_do_processo]

Ex:

mysql> KILL 23435
    
20.05.2016 / 14:21
0

You can configure a timeout .

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

Set a timeout of 30 seconds, and if there is no query response within that interval, an error will be returned. Hence you can handle this error (in your application, for example).

    
20.05.2016 / 14:39