It may not be the exact solution to limit SQL runtime, but I think it will help. You do not need to restart the MySQL server at all.
Try using some GUI tool for MySQL, such as SQLyog . There you can manually stop the executed request (check the X button in the screenshot) if you think it takes longer.
And besides, you can also kill the request process by accessing the list of processes. Check out the other two images in the screenshot with the steps to kill the processes ...

Hope this helps ....
Shubhansh
source share