In this section, you will use MySQL Workbench to carry out administrative functions, such as starting and stopping the server.
Launch MySQL Workbench. You will be presented with the Home window.
To administer your MySQL Server, you must first create a MySQL Connection. Our example already has two connections created, but let us create a new connection. From the MySQL Workbench Home window, click the [+] icon near the MySQL Connections label. This opens the Setup New Connection wizard.
Define the Connection Name value, which we will set to "MyFirstConnection" in this example.
The default connection values are for a typical local setup, so check them and enter the appropriate values. If you are unsure, click the Test Connection button to check the connection parameters. Do not press OK.
Next, click Configure Server Management..., which opens up the Configure Local Management wizard:
Read the Configure Local Management introduction, and press Next to begin defining the new connection parameters.
The connection will now be tested. You should see that the connection was successful. If not, click Back and check that you have entered the information correctly.
Toggle the Show Logs to view additional details about the tested connection, then click Next.
Optionally, you may configure a method for remote management if a Remote Host was specified. Setting these options enables MySQL Workbench to determine the location of configuration files, and the correct start and stop commands to use for the connection.
SSH login based management and Native Windows remote management types are available. The Operating System and MySQL Installation Type are configured for the SSH login variant.
We are creating a local MySQL connection in this tutorial, so are skipping the Management and OS and SSH Configuration options, as they are used for configuring a remote MySQL connection.
On Microsoft Windows, select the appropriate MySQL service for the MySQL connection.
The wizard will now check its ability to access the start and stop commands, and check access to the MySQL Server configuration file.
You now have a chance to review the configuration settings. The information displayed varies slightly depending on platform, connection method, and installation type.
At the Review Settings prompt, choose "I'd like to review the settings again" to review the settings. Choosing "Continue" closes the "Configure Server Management" dialog.
Check the Change Parameters if you want to check or edit information about the MySQL configuration file. In our example we will check it, and click Next to continue.
Review the MySQL configuration file information. Click the Check buttons to perform the described checks, or optionally change the configuration file path.
Optionally, enter your own commands for starting, stopping, and checking the MySQL connection. Typically the default values are used, which means leaving these optional values blank.
Click Finish to close the "Configure Server Management" dialog, which reveals the original Setup New Connection window.
After reviewing the Setup New Connection information, press Test Connection again to make sure it still functions, and then OK to create the new MySQL connection.
You will now be returned to the Home window. You will see the new MySQL connection that you created, named MyFirstConnection.
You are now ready to test your new MySQL connection.
From the Home window, double-click the MySQL connection you created to open up the SQL editor for this connection. The SQL editor is the default page, so now select the Server Status from the left Navigator panel. This displays the status of the MySQL server from your new MySQL connection.
Click around the Navigator panel and view the other MANAGEMENT and INSTANCE pages that relate to your new MySQL connection.
Notice the Management and Schemas tabs on the bottom of the Navigator panel. The Schemas view displays the schemas that are associated with your new MySQL connection. Alternatively, you can merge the Schemas and Management tabs by either clicking the merge icon on the top right of the Navigator panel, or by setting the Show Management Tools and Schema Tree in a single tab SQL Editor preference.
You have now seen how to create a MySQL connection to enable you to manage a MySQL server.
For further information, see Chapter 5, MySQL Connections.