The results area of the screen shows the results from executed statements. If the script contains multiple statements, a result tab will be generated for each statemented that returned results. The following figure shows a single tab and highlights the main actions of the result grid navigation panel.
MySQL Workbench handles quoting and escaping for strings entered into the results grid, so adding quotes and proper escaping here is optional.
It is possible to enter a function, or other expression, into
a field. Use the prefix
\func to prevent
MySQL Workbench from escaping quotation marks. For example, for
md5('fred'), MySQL Workbench
normally would generate the code
md5(\'fred\'). To prevent this, enter the
\func md5('fred') to ensure
that the quoting is not escaped.
Elements of the result grid navigation panel include:
Reset: Resets all sorted columns.
Refresh: Refreshes all data by re-executing the original statement.
Filter Rows: performs a case-insensitive search of all cells. It automatically refreshes, and there is also the refresh button to perform this action manually.
Edit Current Row: Edit the current row.
Add New Row: Adds a new empty row, and highlights it in edit mode. Click to execute (and review) the insert row query.
Delete Selected Rows: Deletes the selected rows. Click to execute (and review) the delete query.
Export: Writes a result set to a CSV, HTML, JSON, SQL INSERT, Excel, XML, or Tab separated file as required.Note
This exports a result set. To export an entire table or schema, see Data Export.
Import: Import records from an external CSV file.
Wrap Cell Content: If the contents of a cell exceeds the cell width, then the data will be cut off with an ellipses. This option will instead wrap the contents within the cell, and adjust the cell height accordingly.Note
The "Refresh" button automatically adjusts the column width to match the longest string one of its cells. You may also manually adjust the column width.
Right-clicking on a results grid tab opens the context-menu, which appears in the figure that follows.
The result grid context menu includes:
Right-clicking on a results grid field opens the context-menu, which appears in the figure that follows.
The result grid field-context menu includes: