如何获取当前在我的 MySQL 服务器上运行的所有查询的完整列表?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16571416/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 17:39:08  来源:igfitidea点击:

How can I get a full list of all queries currently running on my MySQL server?

mysqlsql

提问by Ethan Allen

I am using MySQL Administrator and MySQL Workbench to view my current threads and connections, and the query is shown within those apps, but it's just way too long and runs off the screen.

我正在使用 MySQL Administrator 和 MySQL Workbench 来查看我当前的线程和连接,并且查询显示在这些应用程序中,但它太长并且在屏幕上运行。

What is a simple way to see all queries no matter how long they are? Is there a simple SQL statement I can just run?

有什么简单的方法可以查看所有查询,无论它们有多长?是否有我可以运行的简单 SQL 语句?

回答by Nikolai

Run the following command in order to see full query in the output:

运行以下命令以查看输出中的完整查询:

mysql>SHOW FULL PROCESSLIST;

Look for more information here: How to see full query from SHOW PROCESSLIST

在此处查找更多信息: 如何查看来自 SHOW PROCESSLIST 的完整查询

In order to see all queries you MUST have PROCESS privilege.

为了查看所有查询,您必须具有 PROCESS 权限。

回答by zmf

Run the following command:

运行以下命令:

mysql> show processlist;