The main tabsheets area contains several tabs:
Live Schema Overview Tabsheet
Output Tabsheet
History Tabsheet
Results Tabsheets
Live Editing Tabsheet
Each of these is described in more detail in the following sections.
This tabsheet provides an overview of the schema. The schema objects Tables, Views and Routines are displayed for the current schema.
The Output tabsheet displays a summary of the communication between the script and the server. The messages displayed can be information or errors. Each message displays the time, the action that was carried out, and the response from the server. This is useful for troubleshooting scripts.
The History tabsheet provides a history of SQL operations carried out. Both the time of the SQL operation and the SQL code itself is recorded. To view the SQL executed, click the time, and the SQL code executed will be displayed in the SQL column.
When you enter SQL code into the SQL Query area, you can use the Save SQL to Snippets List toolbar button to save your SQL code. At the time of saving you will be asked to specify a name. These named snippets can be viewed from the SQL Snippets Tab. You can load any SQL snippet into the SQL Query area by double-clicking the desired snippet in the Snippets Palette.
The results area of the screen shows the results from any queries that have been executed. If the script contains multiple queries then multiple result tabs will be generated, one for each query that returns results.
Controls are provided to allow you to easily move over the results. These are shown in the following screenshot:
There are a number of controls available. The controls from left to right are:
Move to first row: Highlights the first record in the current result set.
Move to previous row: Highlights the previous record.
Move to next row: Highlights the next record.
Move to last row: Highlights the last record in the current result set.
Toggle wrapping of cell contents: The data in the cell can either be truncated or wrapped. This button enables you to toggle between these options.
Sort Ascending: Sorts selected column in ascending order.
Sort Descending: Sorts column in descending order.
Export record set to an external file: Outputs record set to a CSV, HTML, or XML file as required.
Refresh Data from Data Source: Refreshes the current result set from the data source.
Search for substring within data: Search data for the string entered in the search box.
It is possible to edit data in real time using the Live Editing tabsheets. In the Overview tab, if a table is double-clicked, a live editing tab will be launched, allowing you to edit the data maintained in that table. Field data can be edited by clicking a field and entering the required data, or editing existing data. In addition to the controls offered by the Results tabsheet, the Live Editor tab features some additional controls. These controls are highlighted in the following screenshot:
From left to right the highlighted controls are:
Edit current row: Enters edit mode for the currently selected record.
Insert new row: Inserts a new row and enables you to enter data. Your changes will not be reflected on the live server until you click .
Delete selected rows: Removes the selected rows. Your changes will not be reflected on the live server until you click .
Apply changes to data: Applies any changes that may have been made to the data fields to the live server.
Discard changes to data: Discards any changes that may have been made to the data fields, and does not apply them to the live server.
These additional controls allow you to apply or discard any changes you may have made to the field data. If changes are applied, the data will then be synchronized with the live server. If changes are discarded the live server will not be affected.
It is possible to enter a function, or other expression,
into a field. If doing so, the prefix
\func
should be used, to prevent
MySQL Workbench from escaping quotation marks. For example, if
entering the expression md5('fred')
MySQL Workbench would generate the code
md5(\'fred\')
. To prevent this enter the
expression as \func md5('fred')
. This
will ensure that the quoting is not escaped.
See also Section 16.6.7.1.3.9, “The Inserts Tab”.