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

时间:2022-03-13 15:45:51

This question already has an answer here:

这个问题在这里已有答案:

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语句吗?

2 个解决方案

#1


46  

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权限。

#2


3  

Run the following command:

运行以下命令:

mysql> show processlist;

#1


46  

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权限。

#2


3  

Run the following command:

运行以下命令:

mysql> show processlist;