Set time limit on SQL query in mySQL

Posted on 2006-04-06
Last Modified: 2008-02-07
I have some new pages and every so often I get a query (usually during testing) that starts hogging the resource and all the other queries slow to a halt. I am wondering it there is a variable in mySQL that I can set to kill processes that are over a certain time limit. I use phpMyAdmin and see a "Time" column and the longer ones need to be killed. I would like for the DB to do this if they reach a certain limit.


Question by:td234
    LVL 30

    Accepted Solution

    No, there is no way to do this automatically.  If the query is actively returning data (not idle), MySQL provides no mechanism to kill it after reaching a certain time threshold.
    LVL 2

    Author Comment

    Thanks once again Todd.
    LVL 30

    Expert Comment

    Sorry there's not a better answer - I expect we will see this type of enterprise-level administrative support pretty soon.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now