How can I stop a MySQL query if it takes too long?

后端 未结 9 1603
野趣味
野趣味 2020-12-02 09:22

Is it possible to timeout a query in MySQL?

That is, if any query exceeds the time I specify, it will be killed by MySQL and it will return an error instead of waiti

9条回答
  •  难免孤独
    2020-12-02 09:45

    Since MySQL 5.7.8 there is max_execution_time option that defines the execution timeout for SELECT statements.

提交回复
热议问题