Want to see last executed queries in MySql Workbench whether its
要查看MySql工作台中的最后一个已执行的查询。
create / alter table query
创建/更改表查询。
select / insert / update query or any query list.
选择/插入/更新查询或任何查询列表。
in short want to see history of all queries
简而言之,希望看到所有查询的历史。
4 个解决方案
#1
59
From the bottom panel, change "Action Output" to "History" and then choose the appropriate date.
从底部面板,将“动作输出”更改为“历史”,然后选择合适的日期。
Alternatively, the SQL statement history is stored in text files under two locations:
或者,SQL语句历史存储在两个位置的文本文件中:
- sql_history/yyyy-mm-dd e.g., sql_history/2015-04-01: Full Workbench SQL history for all MySQL connections
- sql_history/yyyy-mm-dd,例如sql_history/2015-04-01:所有MySQL连接的完整工作台SQL历史。
- log/sql_actions_.log*: SQL history execution results, but without the data, and separated per MySQL connection
- 日志/ sql_actions_。日志*:SQL历史执行结果,但没有数据,并将每个MySQL连接分隔开。
The location of these files depends on your system. For additional details, see MySQL Workbench Settings and Log Files
这些文件的位置取决于您的系统。有关其他详细信息,请参阅MySQL工作台设置和日志文件。
In both cases, you will see the query history.
在这两种情况下,您将看到查询历史。
#2
5
C:\Users[WinUser]\AppData\Roaming\MySQL\Workbench\sql_history
C:\[WinUser]\ AppData \漫游\ MySQL用户\工作台\ sql_history
you find a log file for each day. It includes manual and automated queries from workbench (e.g. UPDATES via edit in Table)
您可以找到每天的日志文件。它包括来自工作台的手动和自动查询(例如,通过编辑表更新)
#3
2
You will find a complete History file in:
你会发现一个完整的历史档案:
C:\Users\[WinUser]\AppData\Roaming\MySQL\Workbench\log\sql_actions_unconnected.txt
MySQL C:\Users\[WinUser]\ AppData \漫游\ \工作台\ \ sql_actions_unconnected.txt日志
MySQL Workbench could not open History file for some reason, but I was able to recover my unsaved queries by browsing this history file.
由于某些原因,MySQL Workbench无法打开历史文件,但我可以通过浏览这个历史文件来恢复未保存的查询。
#4
1
Suppose that you can no longer connect to a previous MySQL database instance, and you just want to see your SQL history from the editors. To retrieve your saved queries from the previous text editors in MySQLWorkbench, do this:
假设您不能再连接到以前的MySQL数据库实例,而只想从编辑器中看到SQL历史。要从MySQLWorkbench中以前的文本编辑器中检索保存的查询,请执行以下操作:
-
Locate your MySQLWorkbench settings folder:
找到MySQLWorkbench设置文件夹:
- Windows
%AppData%\MySQL\Workbench\
- Windows % AppData % \ MySQL \工作台\
- macOS
~username/Library/Application Support/MySQL/Workbench/
- macOS ~用户名/图书馆/应用程序/ MySQL /工作台/支持
- Linux
~username/.mysql/workbench/
- Linux ~用户名/ .mysql /工作台/
- Windows
-
Open the folder
sql_workspaces
打开文件夹sql_workspaces
-
You should see folders of your previous database connections. Navigate into one of them.
您应该看到以前的数据库连接的文件夹。导航到其中一个。
-
There should be several "*.scratch" files, which are text files of editor history of SQL queries.
应该有几个“*”。文件,这是SQL查询的编辑历史的文本文件。
-
Open these *.scratch files in a text editor, and copy the contents.
打开这些*。在文本编辑器中创建文件,并复制内容。
#1
59
From the bottom panel, change "Action Output" to "History" and then choose the appropriate date.
从底部面板,将“动作输出”更改为“历史”,然后选择合适的日期。
Alternatively, the SQL statement history is stored in text files under two locations:
或者,SQL语句历史存储在两个位置的文本文件中:
- sql_history/yyyy-mm-dd e.g., sql_history/2015-04-01: Full Workbench SQL history for all MySQL connections
- sql_history/yyyy-mm-dd,例如sql_history/2015-04-01:所有MySQL连接的完整工作台SQL历史。
- log/sql_actions_.log*: SQL history execution results, but without the data, and separated per MySQL connection
- 日志/ sql_actions_。日志*:SQL历史执行结果,但没有数据,并将每个MySQL连接分隔开。
The location of these files depends on your system. For additional details, see MySQL Workbench Settings and Log Files
这些文件的位置取决于您的系统。有关其他详细信息,请参阅MySQL工作台设置和日志文件。
In both cases, you will see the query history.
在这两种情况下,您将看到查询历史。
#2
5
C:\Users[WinUser]\AppData\Roaming\MySQL\Workbench\sql_history
C:\[WinUser]\ AppData \漫游\ MySQL用户\工作台\ sql_history
you find a log file for each day. It includes manual and automated queries from workbench (e.g. UPDATES via edit in Table)
您可以找到每天的日志文件。它包括来自工作台的手动和自动查询(例如,通过编辑表更新)
#3
2
You will find a complete History file in:
你会发现一个完整的历史档案:
C:\Users\[WinUser]\AppData\Roaming\MySQL\Workbench\log\sql_actions_unconnected.txt
MySQL C:\Users\[WinUser]\ AppData \漫游\ \工作台\ \ sql_actions_unconnected.txt日志
MySQL Workbench could not open History file for some reason, but I was able to recover my unsaved queries by browsing this history file.
由于某些原因,MySQL Workbench无法打开历史文件,但我可以通过浏览这个历史文件来恢复未保存的查询。
#4
1
Suppose that you can no longer connect to a previous MySQL database instance, and you just want to see your SQL history from the editors. To retrieve your saved queries from the previous text editors in MySQLWorkbench, do this:
假设您不能再连接到以前的MySQL数据库实例,而只想从编辑器中看到SQL历史。要从MySQLWorkbench中以前的文本编辑器中检索保存的查询,请执行以下操作:
-
Locate your MySQLWorkbench settings folder:
找到MySQLWorkbench设置文件夹:
- Windows
%AppData%\MySQL\Workbench\
- Windows % AppData % \ MySQL \工作台\
- macOS
~username/Library/Application Support/MySQL/Workbench/
- macOS ~用户名/图书馆/应用程序/ MySQL /工作台/支持
- Linux
~username/.mysql/workbench/
- Linux ~用户名/ .mysql /工作台/
- Windows
-
Open the folder
sql_workspaces
打开文件夹sql_workspaces
-
You should see folders of your previous database connections. Navigate into one of them.
您应该看到以前的数据库连接的文件夹。导航到其中一个。
-
There should be several "*.scratch" files, which are text files of editor history of SQL queries.
应该有几个“*”。文件,这是SQL查询的编辑历史的文本文件。
-
Open these *.scratch files in a text editor, and copy the contents.
打开这些*。在文本编辑器中创建文件,并复制内容。