# Chapter 2 Installing and Upgrading MySQL

**Table of Contents**

[2.1 General Installation Guidance](general-installation-issues.html)
[2.1.1 Supported Platforms](platform-support.html)
[2.1.2 Which MySQL Version and Distribution to Install](which-version.html)
[2.1.3 How to Get MySQL](getting-mysql.html)
[2.1.4 Verifying Package Integrity Using MD5 Checksums or GnuPG](verifying-package-integrity.html)
[2.1.5 Installation Layouts](installation-layouts.html)
[2.1.6 Compiler-Specific Build Characteristics](compiler-characteristics.html)
[2.2 Installing MySQL on Unix/Linux Using Generic Binaries](binary-installation.html)
[2.3 Installing MySQL on Microsoft Windows](windows-installation.html)
[2.3.1 MySQL Installation Layout on Microsoft Windows](windows-installation-layout.html)
[2.3.2 Choosing an Installation Package](windows-choosing-package.html)
[2.3.3 MySQL Installer for Windows](mysql-installer.html)
[2.3.4 Installing MySQL on Microsoft Windows Using a`noinstall` ZIP Archive](windows-install-archive.html)
[2.3.5 Troubleshooting a Microsoft Windows MySQL Server Installation](windows-troubleshooting.html)
[2.3.6 Windows Postinstallation Procedures](windows-postinstallation.html)
[2.3.7 Windows Platform Restrictions](windows-restrictions.html)
[2.4 Installing MySQL on macOS](macos-installation.html)
[2.4.1 General Notes on Installing MySQL on macOS](macos-installation-notes.html)
[2.4.2 Installing MySQL on macOS Using Native Packages](macos-installation-pkg.html)
[2.4.3 Installing and Using the MySQL Launch Daemon](macos-installation-launchd.html)
[2.4.4 Installing and Using the MySQL Preference Pane](macos-installation-prefpane.html)
[2.5 Installing MySQL on Linux](linux-installation.html)
[2.5.1 Installing MySQL on Linux Using the MySQL Yum Repository](linux-installation-yum-repo.html)
[2.5.2 Installing MySQL on Linux Using the MySQL APT Repository](linux-installation-apt-repo.html)
[2.5.3 Installing MySQL on Linux Using the MySQL SLES Repository](linux-installation-sles-repo.html)
[2.5.4 Installing MySQL on Linux Using RPM Packages from Oracle](linux-installation-rpm.html)
[2.5.5 Installing MySQL on Linux Using Debian Packages from Oracle](linux-installation-debian.html)
[2.5.6 Deploying MySQL on Linux with Docker](linux-installation-docker.html)
[2.5.7 Installing MySQL on Linux from the Native Software Repositories](linux-installation-native.html)
[2.5.8 Installing MySQL on Linux with Juju](linux-installation-juju.html)
[2.5.9 Managing MySQL Server with systemd](using-systemd.html)
[2.6 Installing MySQL Using Unbreakable Linux Network (ULN)](uln-installation.html)
[2.7 Installing MySQL on Solaris](solaris-installation.html)
[2.7.1 Installing MySQL on Solaris Using a Solaris PKG](solaris-installation-pkg.html)
[2.8 Installing MySQL on FreeBSD](freebsd-installation.html)
[2.9 Installing MySQL from Source](source-installation.html)
[2.9.1 Source Installation Methods](source-installation-methods.html)
[2.9.2 Source Installation Prerequisites](source-installation-prerequisites.html)
[2.9.3 MySQL Layout for Source Installation](source-installation-layout.html)
[2.9.4 Installing MySQL Using a Standard Source Distribution](installing-source-distribution.html)
[2.9.5 Installing MySQL Using a Development Source Tree](installing-development-tree.html)
[2.9.6 Configuring SSL Library Support](source-ssl-library-configuration.html)
[2.9.7 MySQL Source-Configuration Options](source-configuration-options.html)
[2.9.8 Dealing with Problems Compiling MySQL](compilation-problems.html)
[2.9.9 MySQL Configuration and Third-Party Tools](source-configuration-third-party.html)
[2.9.10 Generating MySQL Doxygen Documentation Content](source-installation-doxygen.html)
[2.10 Postinstallation Setup and Testing](postinstallation.html)
[2.10.1 Initializing the Data Directory](data-directory-initialization.html)
[2.10.2 Starting the Server](starting-server.html)
[2.10.3 Testing the Server](testing-server.html)
[2.10.4 Securing the Initial MySQL Account](default-privileges.html)
[2.10.5 Starting and Stopping MySQL Automatically](automatic-start.html)
[2.11 Upgrading MySQL](upgrading.html)
[2.11.1 Before You Begin](upgrade-before-you-begin.html)
[2.11.2 Upgrade Paths](upgrade-paths.html)
[2.11.3 What the MySQL Upgrade Process Upgrades](upgrading-what-is-upgraded.html)
[2.11.4 Changes in MySQL 8.0](upgrading-from-previous-series.html)
[2.11.5 Preparing Your Installation for Upgrade](upgrade-prerequisites.html)
[2.11.6 Upgrading MySQL Binary or Package-based Installations on Unix/Linux](upgrade-binary-package.html)
[2.11.7 Upgrading MySQL with the MySQL Yum Repository](updating-yum-repo.html)
[2.11.8 Upgrading MySQL with the MySQL APT Repository](updating-apt-repo.html)
[2.11.9 Upgrading MySQL with the MySQL SLES Repository](updating-sles-repo.html)
[2.11.10 Upgrading MySQL on Windows](windows-upgrading.html)
[2.11.11 Upgrading a Docker Installation of MySQL](upgrade-docker-mysql.html)
[2.11.12 Upgrade Troubleshooting](upgrade-troubleshooting.html)
[2.11.13 Rebuilding or Repairing Tables or Indexes](rebuilding-tables.html)
[2.11.14 Copying MySQL Databases to Another Machine](copying-databases.html)
[2.12 Downgrading MySQL](downgrading.html)
[2.13 Perl Installation Notes](perl-support.html)
[2.13.1 Installing Perl on Unix](perl-installation.html)
[2.13.2 Installing ActiveState Perl on Windows](activestate-perl.html)
[2.13.3 Problems Using the Perl DBI/DBD Interface](perl-support-problems.html)

[]()

 This chapter describes how to obtain and install MySQL. A summary of the procedure follows and later sections provide the details. If you plan to upgrade an existing version of MySQL to a newer version rather than install MySQL for the first time, see [Section 2.11, “Upgrading MySQL”](upgrading.html), for information about upgrade procedures and about issues that you should consider before upgrading.

 If you are interested in migrating to MySQL from another database system, see [Section A.8, “MySQL 8.0 FAQ: Migration”](faqs-migration.html), which contains answers to some common questions concerning migration issues.

 Installation of MySQL generally follows the steps outlined here:

1. **Determine whether MySQL runs and is supported on your platform.**

    Please note that not all platforms are equally suitable for running MySQL, and that not all platforms on which MySQL is known to run are officially supported by Oracle Corporation. For information about those platforms that are officially supported, see [https://www.mysql.com/support/supportedplatforms/database.html](https://www.mysql.com/support/supportedplatforms/database.html) on the MySQL website.

2. **Choose which distribution to install.**

    Several versions of MySQL are available, and most are available in several distribution formats. You can choose from pre-packaged distributions containing binary (precompiled) programs or source code. When in doubt, use a binary distribution. Oracle also provides access to the MySQL source code for those who want to see recent developments and test new code. To determine which version and type of distribution you should use, see [Section 2.1.2, “Which MySQL Version and Distribution to Install”](which-version.html).

3. **Download the distribution that you want to install.**

    For instructions, see [Section 2.1.3, “How to Get MySQL”](getting-mysql.html). To verify the integrity of the distribution, use the instructions in [Section 2.1.4, “Verifying Package Integrity Using MD5 Checksums or GnuPG”](verifying-package-integrity.html).

4. **Install the distribution.**

    To install MySQL from a binary distribution, use the instructions in [Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”](binary-installation.html). Alternatively, use the [Secure Deployment Guide](https://dev.mysql.com/doc/mysql-secure-deployment-guide/8.0/en/), which provides procedures for deploying a generic binary distribution of MySQL Enterprise Edition Server with features for managing the security of your MySQL installation.

    To install MySQL from a source distribution or from the current development source tree, use the instructions in [Section 2.9, “Installing MySQL from Source”](source-installation.html).

5. **Perform any necessary postinstallation setup.**

    After installing MySQL, see [Section 2.10, “Postinstallation Setup and Testing”](postinstallation.html) for information about making sure the MySQL server is working properly. Also refer to the information provided in [Section 2.10.4, “Securing the Initial MySQL Account”](default-privileges.html). This section describes how to secure the initial MySQL `root` user account, *which has no password* until you assign one. The section applies whether you install MySQL using a binary or source distribution.

6. If you want to run the MySQL benchmark scripts, Perl support for MySQL must be available. See [Section 2.13, “Perl Installation Notes”](perl-support.html).

 Instructions for installing MySQL on different platforms and environments is available on a platform by platform basis:

* **Unix, Linux, FreeBSD**

   For instructions on installing MySQL on most Linux and Unix platforms using a generic binary (for example, a `.tar.gz` package), see [Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”](binary-installation.html).

   For information on building MySQL entirely from the source code distributions or the source code repositories, see [Section 2.9, “Installing MySQL from Source”](source-installation.html)

   For specific platform help on installation, configuration, and building from source see the corresponding platform section:

  * Linux, including notes on distribution specific methods, see [Section 2.5, “Installing MySQL on Linux”](linux-installation.html).

  * IBM AIX, see [Section 2.7, “Installing MySQL on Solaris”](solaris-installation.html).

  * FreeBSD, see [Section 2.8, “Installing MySQL on FreeBSD”](freebsd-installation.html).

* **Microsoft Windows**

   For instructions on installing MySQL on Microsoft Windows, using either the MySQL Installer or Zipped binary, see [Section 2.3, “Installing MySQL on Microsoft Windows”](windows-installation.html).

   For details and instructions on building MySQL from source code using Microsoft Visual Studio, see [Section 2.9, “Installing MySQL from Source”](source-installation.html).

* **macOS**

   For installation on macOS, including using both the binary package and native PKG formats, see [Section 2.4, “Installing MySQL on macOS”](macos-installation.html).

   For information on making use of an macOS Launch Daemon to automatically start and stop MySQL, see [Section 2.4.3, “Installing and Using the MySQL Launch Daemon”](macos-installation-launchd.html).

   For information on the MySQL Preference Pane, see [Section 2.4.4, “Installing and Using the MySQL Preference Pane”](macos-installation-prefpane.html).

