如何停止运行 MySQL 查询?
在停止MySQL的运行查询之前,我们首先需要看到有多少个进程。
使用show命令运行。
查询如下所示 −
mysql> show processlist;登录后复制
+----+-----------------+-----------------+----------+---------+-------+------------------------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+-----------------+-----------------+----------+---------+-------+------------------------+------------------+ | 4 | event_scheduler | localhost | NULL | Daemon | 71034 | Waiting on empty queue | NULL | | 8 | Manish | localhost:53496 | business | Query | 0 | starting |show processlist| +----+-----------------+-----------------+----------+---------+-------+------------------------+------------------+ 2 rows in set (0.00 sec)登录后复制
call mysql.rds_kill(valueOfGivenIdInProcesslist); 登录后复制
mysql> CALL mysql.rds_kill(8);登录后复制
ERROR 2013 (HY000): Lost connection to MySQL server during query 登录后复制
stopped or not. The syntax for that is as follows −
use yourDatabaseName;登录后复制
The above syntax is applied to the mydatabase name ‘business’ in the system. The query is as follows −
mysql> use business; 登录后复制
No connection. Trying to reconnect... Connection id: 10 Current database: *** NONE *** Database changed mysql>登录后复制
以上就是如何停止运行 MySQL 查询?的详细内容,更多请关注每日运维网(www.mryunwei.com)其它相关文章!