How do I Interrupt a long query in the mysql command line tool without quitting mysql?

前端 未结 5 1013
囚心锁ツ
囚心锁ツ 2020-12-29 22:12

While debugging SQL statements, if I accidentally execute a query in using the mysql command line that outputs at lot of results (even if the query itself executes in reaso

5条回答
  •  执念已碎
    2020-12-29 22:35

    From the current mysql docs:

    As of MySQL 5.1.10, typing Control-C causes mysql to attempt to kill the current statement. If this cannot be done, or Control-C is typed again before the statement is killed, mysql exits. Previously, Control-C caused mysql to exit in all cases.

    Since I was using version 5.0.67 seems that updating mysql would be the best fix. However I have accepted Schwern's answer because it was quick to implement and works like a dream.

提交回复
热议问题