来自这个问题,我知道我可以使用<代码<代码>显示完整的ProcessList 以获取活动查询列表。但是查询在运行查询后消失。是否有一种方法可以在查询运行时列出先前运行的查询或某些日志文件?
注意 - 我正在使用dbeaver使用显示完整的ProcessList
查看查询。
From this question, I learned that I can use SHOW FULL PROCESSLIST
to get a list of active queries. But the query disappears after running the query. Is there a way to list the previously run queries or to some log files when a query is running?
Note - I'm using DBeaver to view queries using SHOW FULL PROCESSLIST
发布评论
评论(2)
查询经理在这种情况下为您提供帮助。转到“窗口/显示视图/查询管理器”,或从主工具栏中的交易选项旁边的下拉菜单中选择它。
The query manager helps you in this case. Go to "Window/ Show View/ Query Manager" or select it from the drop-down menu beside transaction options in the main toolbar.
我发现这适用于Mariadb实例,因此它可能适用于您使用的MySQL。
有一个记录功能可以设置并启用DB记录所有查询的所有查询。这是我发现的链接,然后在下面复制的是步骤。
首先在DBEAVER中连接到DB。然后运行以下语句以启用记录。
您最终将获得一个文件
mycustom.log
在var/log/mysql/
下,每个查询都针对DB进行了。改编自:
I found this works for a MariaDB instance so it might work for whatever MySQL you're using.
There is a logging feature that can be setup and enabled for the DB to log out all queries executed. Here is a link I found and then copied below are the steps.
First connect to your DB in DBeaver. Then run the following statements to enable logging.
What you will end up with is a file
mycustom.log
undervar/log/mysql/
with every query that was ran against the DB.Adapted from: https://gist.github.com/joseluisq/40ec9169669aa1848492141fa6f57fcb