Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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).

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
Thanks. I guess if java can do it, it is possible in any language. –  ring0 Nov 22 '10 at 2:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.