Objectives

In this lab, you will install MySQL and log in to MySQL Workbench.

MySQL and MySQL Workbench

MySQL is an open-source relational database management system (RDBMS). The acronym "SQL" (sometimes pronounced "sequel") stands for Structured Query Language. SQL is a standard computer language for relational database management and data manipulation. SQL is used to query, insert, update and modify data in a database.

MySQL Workbench is a visual database design tool that integrates SQL development, administration, database design, creation and maintenance into a single integrated development environment for the MySQL database system.

In this lab, you will install the various components that make up a MySQL database, including the MySQL server and the MySQL Workbench application.

Note: Steps 2, 3 and 4 cover Windows installation; Mac users should skip to step 5.

Download the installer

You can download the MySQL installer here: https://dev.mysql.com/downloads/windows/installer/8.0.html

Select the second of the two options shown in the image below:

Note that you do not need to sign up for an Oracle Web account - just select "No thanks, just start my download" which can be found under the grey box with the Login and Sign up buttons.

Run the installation

Once you have downloaded the MySQL installer, carry out the following steps to install MySQL:

  • Double click the installer and click "Run".
  • Accept the license terms and select "Next".
  • Leave the Setup type as the Developer Default and click "Next".
  • There are several dependencies that need to be installed on your machine in order to run MySQL (e.g. Visual Studio, Python). The Check Requirements step will identify these. Some can be installed automatically; however, if you see the word "manual" next to an item, you will need to manually download and install that piece of software.

Once you have installed all the dependencies you can continue to MySQL installation.

Installation steps

  • In the High Availabilty section, leave "Standalone MySQL Server" checked and click Next.

  • In the Type and Networking section, click Next to accept these default settings.

  • In Authentication Method, leave the Strong Encryption option checked and proceed by clicking Next.

  • Important: Accounts and Roles:
    • In this step, you need to set a password to use when logging into MySQL Workbench. It is crucial that you note and remember this password.
    • Often, we use the password "root" as a default password for the root user account. If you want to keep it simple and easy to remember, use "root" as your password here.
    • Once you have created your password, click Next (you don't need to do anything in the MySQL User Accounts part of this step).

  • On the Windows Service step, click Next to accept the default settings.

  • In the Apply Configuration section, click Execute.

  • Click Next in Product Configuration.

  • In the Connect To Server section, enter your password (this is the password you created earlier).
  • Click Check; you should receive confirmation that the connection was successful.
  • Then click Next to proceed; then click Finish.

  • Lastly, to install the MySQL samples and examples, click Execute and then Finish.

  • Once installation has completed, MySQL Workbench should launch automatically. In step 4, we will log in to MySQL Workbench.

Log in to MySQL Workbench

Once the MySQL installation is complete, MySQL Workbench should launch automatically.

Under "MySQL Connections" you should see one connection (e.g. Local instance MySQL80). This is the default connection; you can see it uses the default "root" user, the localhost server and port 3306.

Double-click on the connection. You will be asked for a password; this is the password that you set during the installation process.

After entering the correct password, you should see the following view:

You are now logged in to the MySQL Workbench application. In our next lab (the onsite workshop on Friday 14th June) we will create a database and perform some simple queries on the data.

macOS installation

You can download the MySQL installer for macOS here: https://dev.mysql.com/downloads/mysql/

Select macOS as the operating system and choose the first option (DMG archive).

Installing MySQL Community Server

Once you have downloaded the installer, follow the steps described here to install MySQL: https://dev.mysql.com/doc/refman/8.0/en/osx-installation-pkg.html

Using the MySQL preference pane

The MySQL Installation Package includes a MySQL preference pane that enables you to start and stop your MySQL database server. Complete the steps shown here to set this up: https://dev.mysql.com/doc/refman/8.0/en/osx-installation-prefpane.html

Installing MySQL Workbench

Lastly, complete the following steps to install the MySQL Workbench application: https://https://dev.mysql.com/doc/workbench/en/wb-installing-mac.html

Log in to MySQL Workbench

Launch MySQL Workbench. It should look something like this:

Under "MySQL Connections" you should see one connection (e.g. Local instance MySQL80). This is the default connection; you can see it uses the default "root" user, the localhost server and port 3306.

Double-click on the connection. You will be asked for a password; this is the password that you set during the installation process.

After entering the correct password, you should see the following view:

You are now logged in to the MySQL Workbench application. In our next lab (the onsite workshop on Friday 14th June) we will create a database and perform some simple queries on the data.