Some menu items are not available in the MySQL Workbench Community edition of this application, and are available only in MySQL Workbench Commercial. This is indicated where applicable.
Use the File menu to open a project, begin a
new project, or save a project. Choosing New
Model opens the default schema,
mydb. Choosing Open
Model opens a file dialog box with the default file
type set to MySQL Workbench Models (
extension). To display a list of recently opened MWB files, choose
the Open Recent menu item. The keyboard
shortcut to create a new project is Control+N and
the command to open an existing project is
To close the currently active
MySQL Model or
EER Diagram tab, use the Close
Tab menu item. You can also do this from the
keyboard by pressing Control+W. To reopen the
MySQL Model tab, see
Section 126.96.36.199.3, “The View Menu”. To reopen an
Diagram tab, double-click the
Diagram icon in the
section of the
MySQL Model page.
Use the Save Model or Save
Model As menu items to save a model. When you save a
model, its name appears in the title bar of the application. If
you have made changes to a project and have not saved those
changes, an asterisk appears in the title bar following the model
name. When you save a model, it is saved as a MySQL Workbench file
with the extension
Use the Import menu item to import a
MySQL data definition (DDL) script file. For example, this might
be a file created by issuing the command mysqldump
--no-data. MySQL Workbench handles the
script as follows:
If the script does not contain a
schema objects are copied to the default schema,
If the script creates a database, a new tab bearing the
database name is added to the
Schemata section of the
If the script contains data, the data is ignored.
For details about importing a DDL script, see Section 188.8.131.52, “Reverse Engineering Using a Create Script”.
Under the Import submenu, you can also
There are variety of items under the Export submenu. You may generate the SQL statements necessary to create a new database or alter an existing one. For more information about these menu items, see Section 184.108.40.206, “Forward Engineering Using an SQL Script”.
Using the Export submenu, you can also export an EER diagram as a PNG, SVG, PDF, or Postscript file. For an example of a PNG file, see Figure 8.28, “The sakila Database EER Diagram”.
The Page Setup menu item enables you to set the paper size, orientation, and margins for printing purposes.
The printing options are enabled only if the EER Diagrams tab is selected. You have the choice of printing your model directly to your printer, printing it as a PDF file, or creating a PostScript file. For more information, see Section 8.2.1, “Printing Diagrams”.
The printing options are available only in commercial versions of MySQL Workbench.
Use the Document Properties menu item to set the following properties of your project:
Name: The model name (default is
Version: The project version number
Author: The project author
Project: The project name
Created: Not editable; determined by the
MWB file attributes
Last Changed: Not editable; determined by
the MWB file attributes
Description: A description of your project
Use the Edit menu to make changes to objects. The text description for several of the menu items changes to reflect the name of the currently selected object.
This menu has items for cutting, copying, and pasting. These
actions can also be performed using the
Control+X, Control+C, and
Control+V key combinations. Undo a deletion using
the Undo Delete
object_name' item. The
Control+Z key combination can also be used to
undo an operation. It is also possible to carry out a
Redo operation using either the menu
item, or the key combination Control+Y.
Also find a Delete
object_name' menu item
for removing the currently selected object. The keyboard command
for this action is Control+Delete. You can also
right-click an object and choose the delete option from the pop-up
object_name' menu item
behaves differently depending upon circumstances. For example, if
an EER Diagram is active and a table on the
canvas is the currently selected object, a dialog box may open
asking whether you want to remove the table from the canvas only
or from the database as well. For information about setting the
default behavior when deleting from an EER Diagram, see
Section 3.2.4, “Modeling Preferences”.
MySQL Model page is active, the
selected object is deleted from the catalog and there will be
no confirmation dialog box.
Choose Edit Selected to edit the currently selected object. You can also perform edits in a new window by selecting Edit Selected in New Window. The keyboard shortcuts for Edit Selected and Edit Selected in New Window are Control+E and Control+Shift+E, respectively.
The Select item has the following submenus:
Select All (Keyboard shortcut, Control+A): Selects all the objects on the active EER diagram.
Similar Figures (Objects of the same type): Finds objects similar to the currently selected object.
Connected Figures: Finds all the objects connected to the currently selected object.
These menu items are active only when an EER Diagram tab is selected. The Similar Figures and the Connected Figures menu items are disabled if no object is currently selected on an EER diagram.
When multiple objects have been selected using one of these menu items, you can navigate between selected items by choosing the Go to Next Selected or Go to previous Selected menu item.
Selecting objects changes some of the Edit menu items. If only one object is selected, that object's name appears after the Cut, Copy and Delete menu items. If more than one object is selected, these menu items show the number of objects selected.
Each MySQL Workbench window includes search functionality. The Find panel with Find & Replace enabled is shown below:
The Find dialogue options are described below:
String Matching (default) or Regular Expression: Search by matching a string, or a PCRE regular expression.
Ignore Case: A case-insensitive search. Works with both the String Matching and Regular Expression search methods. Enabled by default.
Match Whole Words: If enabled, only whole strings are matched. For example, a search for "home" would not match "home_id". Disabled by default.
Wrap Around: The search will wrap around to the beginning of the document, as otherwise it will only search from the cursor position to the end of the document. Enabled by default.
And the arrows jump to the discovered search terms, and behave according to the Wrap Around option.
The MySQL Workbench Commercial edition includes an advanced Find facility for models:
You can search the following locations:
Entire Model: Searches the entire model.
Current View: Searches the current view only. This may be
MySQL Model page.
All Views: Searches the
MySQL Model Page
and all EER diagrams.
Database Objects: Searches database objects only.
Selected Figures: Searches the currently selected objects. This feature works only for EER diagrams.
Enter the text you wish to search for in the Find Text list. You may also select any or all of the following check boxes:
Use Regular Expression
Search in Comments
Search in SQL for Views, SPs etc.
Any text you enter into the Find Text list is retained for the duration of your session. Use the Next or Previous buttons to find occurrences of your search criterion.
Clicking the Find All button opens a Find Results window anchored at the bottom of the application. If you wish, you may undock this window as you would any other.
Use this window to navigate to objects. For example,
Description of an object
located on an EER diagram navigates to the specific diagram and
selects the object. Notice that the properties of the object are
displayed in the
Find dialog window can also be opened
using the Control+F key combination. Use
Control+G to find the next occurrence and
Control+Shift+G to find a previous occurrence.
Find dialog window by clicking the
x in the top right corner or by pressing
the Esc key.
This menu item enables you to set global preferences for the MySQL Workbench application.
For further information, see Section 3.2, “Workbench Preferences”.
This context-aware menu features general options for changing the view in MySQL Workbench. These options change depending on the current tab, and here are the available View menu items:
Home: Selects the Home window
Panels: Configure which of the three available panels are open. You may also manage this from the GUI using the panel toggle buttons on the top-right side of MySQL Workbench.
Output: Displays the console output.
Select Next Main Tab: Selects the next (moves to the right, and wraps around) MySQL Workbench tab.
Select Next Main Tab: Selects the previous (moves to the left, and wraps around) MySQL Workbench tab.
Windows: A submenu with items that activate (slide open) specific panels. Designated panels include the "Model Navigator", "Catalog", "Layers", "User Datatypes", "Object Descriptions", "Object Properties", and "Undo History".
Zoom 100%: The default level of detail of an EER diagram
Zoom In: Zooms in on an EER diagram.
Zoom Out: Zooms out from an EER diagram.
The ability to zoom in on an EER diagram is also available
using the slider tool in the
Navigator palette. See
Section 220.127.116.11, “The Model Navigator Panel”.
Set Marker: Bookmarks an object. From the keyboard, select the object you wish to bookmark, then use the key combination Control+Shift and the number of the marker (1 through 9). You may create up to nine markers.
Go To Marker: Returns to a marker. From the keyboard, use the Control key and the number of the marker.
Toggle Grid: Displays grid lines on an EER diagram.
Toggle Page Guides: Toggles Page Guides to help design the EER diagram on a per-page basis.
The Arrange menu items apply only to objects on an EER diagram canvas and are enabled only if an EER diagram view is active. The Arrange menu has these items:
Align to Grid: Aligns items on the canvas to the grid lines
Bring to Front: Brings objects to the foreground
Send to Back: Sends objects to the background
Center Diagram Contents: Centers objects on the canvas
Autolayout: Automatically arranges objects on the canvas
Reset Object Size: Expands an object on an EER diagram. For example, if a table has a long column name that is not fully displayed, this menu item expands the table to make the column visible. This menu item is not enabled unless an object is selected.
Expand All: Use this item to expand
all objects on an EER diagram. This item will display a
table's columns if the object notation supports expansion.
Some object notations, such as
not permit expansion or contraction. Indexes will not
automatically be expanded unless they were previously expanded
and have been collapsed using the Collapse
All menu item.
Collapse All: Undo the operation performed by Expand All.
When a model is opened, this menu features actions to perform against your model, and the Model menu has these items:
Add Diagram: Creates a new EER Diagram. The keyboard shortcut is Control+T.
Create Diagram From Catalog Objects: Creates an EER diagram from all the objects in the catalog.
User Defined Types: Presents a dialog box that enables you to add and delete user defined data types.
DBDoc – Model Reporting...: For information about this menu item, see Section 18.104.22.168.5.1, “The DBDoc Model Reporting Dialog Window (Commercial Version)”. Commercial version only.
Validation: Checks the validity of the model using ANSI standards. For information about this menu item, see Section 22.214.171.124.5.2, “The Validation Submenus (Commercial Version)”. Commercial version only.
Validation (MySQL): Checks the validity of the model using MySQL standards. For information about this menu item, see Section 126.96.36.199.5.2, “The Validation Submenus (Commercial Version)”. Commercial version only.
Object Notation: For information about this menu item, see Section 188.8.131.52.5.3, “The Object Notation Submenu”.
Relationship Notation: For information about this menu item, see Section 184.108.40.206.5.4, “The Relationship Notation Submenu”.
Diagram Properties and Size: Opens a diagram size dialog box that enables you to adjust the width or height of the canvas. The unit of measure is pages; the default value is two.
When you have tables with numerous columns, use this menu item to increase the size of the EER.
Model Options: Sets options at the model level. These options should not be confused with the options that are set globally for the Workbench application, and which are referred to as Workbench Preferences. The available model options are a subset of the Workbench Preferences options.
For more information about Workbench Preferences, see Section 3.2.4, “Modeling Preferences”.
This dialog window is found by navigating to the Model menu and choosing the DBDoc - Model Reporting... item.
The DBDoc - Model Reporting... item is not available in the MySQL Workbench Community version.
Use this dialog window to set the options for creating documentation of your database models. For more information, see Section 8.2.2, “DBDoc Model Reporting”.
The Model menu has two validation submenus, Validation and Validation (MySQL). Use these submenus for general validation and MySQL-specific validation of the objects and relationships defined in your model.
These items are not available in the MySQL Workbench Community version.
The Validation submenu has these items:
Validate All: Performs all available validation checks
Empty Content Validation: Checks for objects with no content, such as a table with no columns
Table Efficiency Validation: Checks the efficiency of tables, such as a table with no primary key defined
Duplicate Identifiers Validation: Checks for duplicate identifiers, such as two tables with the same name
Consistency Validation: Checks for consistent naming conventions
Logic Validation: Checks, for example, that a foreign key does not reference a nonprimary key column in the source table
The Validation (MySQL) submenu has these items:
Validate All: Performs all available validation checks
Integrity Validation: Checks for invalid references, such as a table name longer than the maximum permitted
Syntax validation: Checks for correct SQL syntax
Duplicate Identifiers Validation (Additions): Checks for objects with the same name
For detailed information about validation, see Section 8.2.3, “Schema Validation Plugins”.
The items under the Model, Object Notation submenu apply exclusively to an EER diagram. They are not enabled unless an EER diagram tab is selected.
The Object Notation submenu has these items:
Workbench (Default): Displays table columns, indexes, and triggers
Workbench (Simplified): Shows only a table's columns
Classic: Similar to the
Workbench (Simplified) style showing only
the table's columns
IDEF1X: The ICAM DEFinition language information modeling style
The object notation style that you choose persists for the duration of your MySQL Workbench session and is saved along with your model. When MySQL Workbench is restarted, the object notation reverts to the default.
If you plan to export or print an EER diagram be sure to decide on a notation style first. Changing notation styles after objects have been placed on a diagram can significantly change the appearance of the diagram.
The items under the Relationship Notation submenu apply exclusively to an EER diagram. They are not enabled unless an EER diagram tab is selected.
The Relationship Notation submenu has these items:
Crow's Foot (IE): The default modeling style. For an example, see Figure 8.23, “Adding Tables to the Canvas”.
Classic: Uses a diamond shape to indicate cardinality.
Connect to Columns
UML: Universal Modeling Language style.
IDEF1X: The ICAM DEFinition language information modeling method
To view the different styles, set up a relationship between two or more tables and choose the different menu items.
The relationship notation style that you choose persists for the
duration of your MySQL Workbench session and is saved along with
your model. When MySQL Workbench is restarted, the relationship
notation reverts to the default, the
If you plan to export or print an EER diagram, be sure to decide on a notation style first. Changing notation styles after objects have been placed on a diagram can significantly change the appearance of the diagram.
This menu features actions against the connected MySQL server. The Database menu has these items:
Query Database: Launches the SQL Editor, which enables you to create SQL code and execute it on a live server. For more information, see Section 7.1, “Visual SQL Editor”.
Manage Connections: Launches the Manage Server Connections dialog, which enables you to create and manage multiple connections. For more information, see Section 220.127.116.11, “Manage Server Connections”
Reverse Engineer: Creates a model from an existing database. For more information, see Section 18.104.22.168, “Reverse Engineering a Live Database”.
Forward Engineer: Creates a database from a model. For more information, see Section 22.214.171.124, “Forward Engineering to a Live Server”.
Schema Transfer Wizard...: Executes the database migration wizard for MySQL databases. It is useful for moving from an older MySQL server to the latest MySQL version, and is meant for local development purposes. You should not use this tool on production MySQL instances as they often require more complex data migration techniques.
For additional information about this wizard, see MySQL Schema Transfer Wizard.
Migration Wizard...: Executes the database migration wizard for most any database, and is meant to migrate tables and data from supported database systems to your MySQL server. For additional information, see Chapter 9, Database Migration Wizard.
Edit Type Mappings for Generic
Migration: From here you can define custom type
mappings, such as migrating the source data type
int8 to the target MySQL data type
Synchronize Model: Synchronizes your database model with an existing database. For more information, see Section 8.5.1, “Database Synchronization”.
Synchronize with Any Source: Allows you to compare a target database or script with the open model, external script, or a second database, and apply these changes back to the target. For more information, see Section 8.5.1, “Database Synchronization”.
Compare Schemas: Compares your schema model with a live database or a script file. Section 8.5.2, “Compare and Report Differences in Catalogs”.
The Tools menu lists tools and utilities that related to MySQL Workbench usage.
Browse Audit Log File: Launches a file browser to open a specific audit log file. For additional information about the Audit Inspector, see Section 5.6, “MySQL Audit Inspector Interface”. Commercial only.
Configuration: Backup (or restore) your MySQL Connections, as defined in MySQL Workbench.
Utilities: These utilities generate PHP code to either "Connect to the MySQL server" or "Iterate SELECT results", if applicable. For additional information about PHP code generation, see Section 126.96.36.199, “Generating PHP Code”.
Start Shell for MySQL Utilities: Opens the mysqluc MySQL Utility. For additional information about MySQL Utilities, see Appendix F, MySQL Utilities.
This menu features GRT scripting and plugin options. The Scripting menu has these items:
Scripting Shell: Launches the MySQL Workbench Scripting Shell. For additional information, see Section C.5, “The Workbench Scripting Shell”.
New Script: Opens a New Script File dialogue, with options to create a Python Script, Python Plugin, or Python Module.
Open Script: Opens a Open GRT Script dialogue, which defaults to the Workbench scripts directory. Files are opened into the Workbench Scripting Shell window.
Run Script File: Executes the script that is currently open.
Run Workbench Script File: Executes the specified script file.
Install Plugin/Module File: Loads and installs a plugin or module file
Plugin Manager: Displays information about the plugins that are installed, and allows disabling and uninstalling the plugins.
Use the Help menu when you require support, or when you want to help improve MySQL Workbench. This menu has the following items:
Help Index: Opens a window showing a local copy of the MySQL Workbench documentation. Read, search, or print the documentation from this window.
MySQL.com Website: Opens your default browser on the MySQL Web site home page.
Workbench Product Page: Opens your default browser on the MySQL Workbench product page.
System Info: Displays information about your system, which is useful when reporting a bug. For more information, see Section 188.8.131.52.9.1, “System Info”.
Report a Bug: Opens your default browser to bugs.mysql.com, and automatically fills in several fields such as the Operating System and MySQL Workbench version by passing in additional data via the GET request. The default "Description" requests you to also attach the Workbench log file. For additional information about reporting useful bug reports, see Appendix D, How To Report Bugs or Problems.
View Reported Bugs: Opens your default browser to see a list of current bugs.
Locate Log Files: Opens up the directory that contains the MySQL Workbench log files.
Show Log File: Opens up the main
MySQL Workbench log file in your default text editor. This file is
Check For Updates: Checks if you are using the current MySQL Workbench version. If you are, then a popup informs you of this. If not, then a prompt asks you to open the MySQL Workbench download page.
About Workbench: Displays the
About window. This also
displays the MySQL Workbench version.
Use the Help, System Info menu item to display information about your system. This item is especially useful for determining your rendering mode. Sample output follows.
MySQL Workbench Community (GPL) for Windows version 6.1.4 revision 11773 build 1454 Configuration Directory: C:\Users\philip\AppData\Roaming\MySQL\Workbench Data Directory: C:\Users\philip\Desktop\MySQL\MySQL Workbench 6.1.4 CE Cairo Version: 1.8.8 OS: Microsoft Windows 7 Service Pack 1 (build 7601), 64-bit CPU: 4x Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz, 8.0 GiB RAM Active video adapter NVIDIA GeForce GT 610 Installed video RAM: 1024 MB Current video mode: 1920 x 1080 x 4294967296 colors Used bit depth: 32 Driver version: 184.108.40.2069 Installed display drivers: nvd3dumx.dll,nvwgf2umx.dll,nvwgf2umx.dll,nvd3dum,nvwgf2um,nvwgf2um Current user language: English (United States)