sql - Mysql query with auto kill embedded -


is possible create mysql query kills if takes long complete? know if possible predict average time spent on querying, , prevent database exhausting. there tool or native trick tha allow this?

for instance:

select data unpredictable kill if timeout > 2000 /* ms */ 

enviroment: 5.6.19 mysql

  1. for mysql 5.7.4 can top level read-only select statements

server-side-select-statement-timeouts

for example:

set global max_statement_time=1000; 

  1. you try change timeout setting in server

edit my.cnf (the mysql configuration file).

wait_timeout = 28800 interactive_timeout = 28800 

how-to-change-the-mysql-timeout-on-a-server


Comments