
在停止MySQL的运行查询之前,我们首先需要看到有多少个进程。
使用show命令运行。
查询如下所示 −
mysql> show processlist;
After executing the above query, we will get the output with some id’s. This is given as follows −
+----+-----------------+-----------------+----------+---------+-------+------------------------+------------------+| 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)
As seen from the above output, the db currently in use is ‘business’. and its id is 8. To stop the查询命令调用可以与给定的正在运行的进程列表中的ID一起使用。其语法为:is as follows −
call mysql.rds_kill(valueOfGivenIdInProcesslist);
Now, the above syntax is applied to the query and valueOfGivenIdInProcesslist is put as 8. This下面显示的是 −
mysql> CALL mysql.rds_kill(8);
执行上述查询后,获得以下输出 −
一览运营宝
一览“运营宝”是一款搭载AIGC的视频创作赋能及变现工具,由深耕视频行业18年的一览科技研发推出。
41 查看详情
ERROR 2013 (HY000): Lost connection to MySQL server during query
当上述查询停止运行时,就会发生这种情况。使用`use`命令来检查它是否有
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 asfollows −
mysql> use business;
执行上述查询后,获得以下输出 −
No connection. Trying to reconnect...Connection id: 10Current database: *** NONE ***Database changedmysql>
因此,很明显查询已经停止,因为消息是“正在尝试…”在MySQL中,”reconnect…””的意思是重新连接。同时还显示当前数据库为”none”。经过一段时间后,时间与数据库的连接恢复。
以上就是如何停止运行 MySQL 查询?的详细内容,更多请关注创想鸟其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/238087.html
微信扫一扫
支付宝扫一扫