views:

33

answers:

1

I connect to mysql from my Linux shell. Every now and then I run a SELECT query that is too big. It prints and prints and I already know this is not what I meant. I would like to stop the query.

Hitting Ctrl+C (a couple of times) kills mysql completely and takes me back to shell, so I have to reconnect... Is it possible to stop a query without killing mysql itself?

+4  A: 
mysql>show processlist;

kill "number from first col";
iddqd
Thanx, I only knew how to do it in phpmyadmin!
zilverdistel
but `mysql` is printing... I can't see the prompt
David B
run client on another terminal ...
iddqd
I agree with this basic approach, but I think using `KILL QUERY` is slightly preferable to `KILL` for this case. That way the query is killed, but not the connection.
Ike Walker