In the following figure, a SQL SHOW DATABASES statement has just been executed: Output from SQL statement execution appears in a Results panel located beneath the SQL Query panel. The leftmost “lightning” button is provided to execute the entire script contained within the SQL Query panel, whilst the second button executes only the currently selected statement. These may then be executed using the buttons in the toolbar displaying lightning bolts. The SQL Query panel allows SQL commands to be entered. Multiple SQL Editor sessions to multiple servers may be established from the home screen, each with its own tab located beneath the toolbar. It is possible to return to the workbench home screen at any time simply by selecting the Home tab. Once a connection has been established to a database server, the SQL Editor panel will appear as illustrated in the following figure: Report this ad The MySQL Workbench SQL Editor
To connect to the server, simply double click on the connection and enter the password for the specified user. Once created, the connection will be listed in SQL Development column of the home screen: Assuming a successful test, click on OK to establish the connection profile.
Once the appropriate information has been provided, click on the Test Connection button to verify the information is correct and the database server is accessible. Additional options are available by selecting the Advanced tab. On the this screen, enter a descriptive name for the connection, indicate the connection type (TCP/IP, local socket or the more secure TCP/IP with SSH) and specify the name of the user and the port via which the database is to be accessed. Alternatively, click on New Connection to display the new connection dialog: If the required connection is already listed in the SQL Development column of the workbench home page, simply double click on it to establish the connection and enter the corresponding password.
Once running, the home screen should appear as shown in the following figure: To establish such a connection, begin by launching the workbench tool. This may take the form of a local server that is running on the same host as the workbench, or a server running on a remote system. Before any SQL statements can be executed on a database, the MySQL Workbench tool must first establish a connection to the target database server.