Is there a way to associate a time out to a query sent to the MySQL server?
Expected behavior
- MySQL server would trigger a time out if the query did not complete after a time T provided by the caller
- No result would be returned to the caller
- An error would be triggered instead (and caught by the caller).
Didn't find this in the MySQL documentation.
However it seems relevant: in case some indexes are missing or for some other reason, a time out would prevent the server to collapse (some queries may take hours to complete and will get cumulated in the server stack).
Have a look at this link from stackoverflow. It may not meet all your requirements (stated above), but I think it will help.
If you specify which programming language you are using to connect to MySQL server, you may find a better way to do it.