简体   繁体   中英

How to stop mysql query execution if it takes a long time

I need recommendations from an experts of Mysql (innodb on v 5.6+)

  • Server: Ubuntu 18.04
  • Mysql - 5.6
  • nginx (latest)
  • RAM 1gb, proc 2x2.4

What is the problem?

Depending from the some queries execution time takes too long.

Is there any way to stop the execution of the query and return (for example false) if it takes more than N seconds?

Thanks

Mysql indexes is ok, querying and grouping is ok.

If you want stop that take long time execution SQL , here is how to stop it :

  • connect to that MySQL server

  • execute SQL show processlist

  • find id with long execution time

  • execute kill [id]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM