MySQL Installation

This page contains the steps for downloading and installing MySQL.

If you already have MySQL installed you can skip this page. But if you need to install MySQL, this page will help you.

Download MySQL

First step is to download MySQL from the MySQL website.

This link takes you to the MySQL Community Server. This edition is a freely downloadable version MySQL. There are also commercial versions available, however, this tutorial uses the free version.

To check that your platform can run MySQL, see Supported Platforms.

Install MySQL

Once you've downloaded MySQL, the next step is to install it.

The following steps were taken while I installed MySQL 5.6 on my Macbook Pro (MySQL 5.6.24 to be precise). The exact steps taken may differ slightly — this will depend on the MySQL version that you're installing and the operating system that you're installing on to. If you get stuck, see the installation section from the MySQL reference manual.

  1. Extract the Installer Package

    MySQL installation screen 1

    Seeing as I'm installing MySQL onto Mac OS X, I could choose between using the Native Package Installer format or Tar package format, which uses a file packaged using the Unix tar and gzip commands. I chose the Native Package Installer format, which uses the native OS X installer (DMG) to guide me through the installation.

    Therefore, the first step is to double click on the .dmg file.

  2. Launch the Installer

    MySQL installation screen 2

    Double click the .pkg file.

  3. Introduction

    MySQL installation screen 3

    After double clicking the MySQL installer package, the installer should launch into the following Introduction screen.

    Click Continue.

  4. Accept Licence

    MySQL installation screen 4

    Click Continue if you're happy with the licence.

  5. Confirm Licence

    MySQL installation screen 5

    Click Agree to confirm that you agree to the terms of the software licence agreement.

  6. Installation Type

    MySQL installation screen 6

    You can either do a standard installation or you can customize it.

    To do a standard installation click Install, otherwise click Customize.

    For this example, I clicked Install.

  7. Enter Password

    MySQL installation screen 7

    If prompted for a password, go ahead and enter it.

    Click Install Software to start the installation process.

  8. Installing...

    MySQL installation screen 8

    This will install the files. Here's an action shot.

  9. Installation Successful

    MySQL installation screen 9

    Once MySQL has been installed, you should see a screen like this one.

    Click Close to close the installer.

Start MySQL Server

Now that you've installed MySQL, you should start it. On the Mac, you can do this via the System Preferences.

  1. Open MySQL System Preferences

    MySQL installation screen 10

    On the Mac, once you've installed MySQL, you should see a MySQL icon like this inside your System Preferences.

    Click on the icon.

  2. MySQL System Preferences

    MySQL installation screen 11

    The following screen should appear.

  3. Start MySQL

    MySQL installation screen 12

    Click Start MySQL Server.

    The screen should now look like this.

    You might also like to check the box that reads Automatically Start MySQL Server on Startup. This will ensure MySQL starts every time the computer is started.

Linux/Unix/Mac

Linux/Unix systems can use the mysqld_safe command to start MySQL. You can also use this method on the Mac, using Terminal.

To do this:

  1. Open Terminal, and type cd /usr/local/mysql (or where ever MySQL is installed on the machine).
  2. Then type sudo ./bin/mysqld_safe and enter a password if prompted.

Windows

Windows users can go to the command prompt and type the following:

Or where ever MySQL is installed on the machine. Also change the version number to the version you're using.

Windows users can stop MySQL with the following command:

Next we'll take a look at MySQL Workbench. MySQL Workbench is a graphical tool that allows you to perform all sorts of tasks with MySQL.