Halt running MySQL query

1158140 pts.
Tags:
MySQL
SQL Query
Each day, I usually connect to MySQL from a Linux shell. Every once in a while, by accident, I run a query that's way to big and I have to stop it. When I tried Ctrl+C - it stopped all of MySQL and I have to reconnect. Can I just kill this one specific query? Thank you so much.
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

You can use the KILL command.

From the official documentation:

KILL QUERY
terminates the statement the connection is currently
executing, but leaves the connection itself intact.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • ToddN2000
    Thanks for the tip carlosdl. I haven't worked much with MySQL.
    136,530 pointsBadges:
    report
  • carlosdl
    NP.

    I had to investigate it myself some time ago because I need to interact with MySQL databases every now and then, and the exact thing mentioned in this question happened to me several times.
    85,905 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: