Table of Contents [+/-]
This facility in MySQL Workbench provides the functionality that was formerly available in MySQL Query Browser.
MySQL Workbench now provides extensive facilities for working directly with SQL code. Before working directly with a live server a connection must be created. Once a connection is established it is the possible to execute SQL code directly on the server and manipulate the server using SQL code.
The starting point for embarking on SQL Development work is the SQL Development area of the Home screen, which has the following action items:
Open Connection to start Querying
Open Connection to start Querying (icon)
New Connection
Edit Table Data
Edit SQL Script
Manage Connections
Open Connection to start Querying
Clicking on this action item launches the Connect to Database Wizard. From this wizard you can select a predefined connection. A new SQL Editor tab is launched where you
To read about the SQL Editor see Section 6.2, “SQL Editor”.
Open Connection to start Querying (icon)
If you already have created a connection to a database it will appear in this panel as an icon. Double clicking the icon will directly launch a SQL Editor tab, and connect you to the database as defined by the connection.
New Connection
Clicking the New Connection action item launches the Manage DB Connections wizard. This wizard allows you to create a new connection. Note the wizard when launched from here does not display existing connections, it only allows you to create a new connection.
To read more about creating and managing connections see Section 6.1, “Manage Connections”.
Edit Table Data
This action item allows you to edit table data. When clicked the Edit Table Data wizard is launched. This is a two stage wizard. The first stage allows you to select a Stored Connection. The second stage allows you to select the Schema and Table you want to edit. Once the wizard is completed a SQL Editor tab is launched which displays a data grid that allows you to interactively edit table data as required.
Edit SQL Script
Clicking this action item launched the Edit SQL Script wizard. This is a two stage wizard. The first stage allows you to select a Stored Connection. The second stage allows you to select a SQL Script file, and optionally have the script executed after it is opened. Once the wizard is completed a SQL Editor tab will be launched, with the script displayed. If you optionally selected to run the script, the script will run and the results will be displayed.
Manage Connections
Clicking this action item launches the Manage DB Connections wizard. This wizard also displays Stored Connections, which can be selected to change as required. New connections can also be created from this wizard.
To read more about managing connections see Section 6.1, “Manage Connections”.
The SQL Development activities can therefore be grouped into two broad categories:
Creating and managing connections. This functionality is primarily managed through the Manage DB Connections dialog.
Editing, running, and manipulating databases through SQL code. This functionality is associated with what is termed the SQL Editor.
Each of these is described in more detail in the following sections.