Want to see last executed queries in MySql Workbench whether its
create / alter table query
select / insert / update query or any query list.
in short want to see history of all queries
Want to see last executed queries in MySql Workbench whether its
create / alter table query
select / insert / update query or any query list.
in short want to see history of all queries
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:
The location of these files depends on your system. For additional details, see MySQL Workbench Settings and Log Files
In both cases, you will see the query history.
C:\Users[WinUser]\AppData\Roaming\MySQL\Workbench\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)
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. Do this:
Locate your MySQLWorkbench settings folder:
%AppData%\MySQL\Workbench\
/Users/~username/Library/Application Support/MySQL/Workbench/
/Users/~username/.mysql/workbench/
Open the folder sql_workspaces
You should see folders of your previous database connections. Navigate into one of them.
There should be several "*.scratch" files. They are text files of editor history of SQL queries.
Open these *.scratch files in a text editor, and copy the contents.
You will find a complete History file in:
C:\Users\[WinUser]\AppData\Roaming\MySQL\Workbench\log\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.