<div id="docs-body">
 <div class="chapter">
  <div class="titlepage">
   <div>
    <div>
     <h1 class="title">
      <a name="installing">
      </a>
      Chapter 2 Installing MySQL
     </h1>
    </div>
   </div>
  </div>
  <div class="toc">
   <p>
    <b>
     Table of Contents
    </b>
   </p>
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="general-installation-issues.html">
       2.1 General Installation Guidance
      </a>
     </span>
    </dt>
    <dd>
     <dl>
      <dt>
       <span class="section">
        <a href="platform-support.html">
         2.1.1 Supported Platforms
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="which-version.html">
         2.1.2 Which MySQL Version and Distribution to Install
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="getting-mysql.html">
         2.1.3 How to Get MySQL
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="verifying-package-integrity.html">
         2.1.4 Verifying Package Integrity Using MD5 Checksums or GnuPG
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="installation-layouts.html">
         2.1.5 Installation Layouts
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="compiler-characteristics.html">
         2.1.6 Compiler-Specific Build Characteristics
        </a>
       </span>
      </dt>
     </dl>
    </dd>
    <dt>
     <span class="section">
      <a href="binary-installation.html">
       2.2 Installing MySQL on Unix/Linux Using Generic Binaries
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="windows-installation.html">
       2.3 Installing MySQL on Microsoft Windows
      </a>
     </span>
    </dt>
    <dd>
     <dl>
      <dt>
       <span class="section">
        <a href="windows-choosing-package.html">
         2.3.1 Choosing an Installation Package
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="mysql-configurator.html">
         2.3.2 Configuration: Using MySQL Configurator
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="windows-install-archive.html">
         2.3.3 Configuration: Manually
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="windows-troubleshooting.html">
         2.3.4 Troubleshooting a Microsoft Windows MySQL Server Installation
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="windows-postinstallation.html">
         2.3.5 Windows Postinstallation Procedures
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="windows-restrictions.html">
         2.3.6 Windows Platform Restrictions
        </a>
       </span>
      </dt>
     </dl>
    </dd>
    <dt>
     <span class="section">
      <a href="macos-installation.html">
       2.4 Installing MySQL on macOS
      </a>
     </span>
    </dt>
    <dd>
     <dl>
      <dt>
       <span class="section">
        <a href="macos-installation-notes.html">
         2.4.1 General Notes on Installing MySQL on macOS
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="macos-installation-pkg.html">
         2.4.2 Installing MySQL on macOS Using Native Packages
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="macos-installation-launchd.html">
         2.4.3 Installing and Using the MySQL Launch Daemon
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="macos-installation-prefpane.html">
         2.4.4 Installing and Using the MySQL Preference Pane
        </a>
       </span>
      </dt>
     </dl>
    </dd>
    <dt>
     <span class="section">
      <a href="linux-installation.html">
       2.5 Installing MySQL on Linux
      </a>
     </span>
    </dt>
    <dd>
     <dl>
      <dt>
       <span class="section">
        <a href="linux-installation-yum-repo.html">
         2.5.1 Installing MySQL on Linux Using the MySQL Yum Repository
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="linux-installation-apt-repo.html">
         2.5.2 Installing MySQL on Linux Using the MySQL APT Repository
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="linux-installation-sles-repo.html">
         2.5.3 Using the MySQL SLES Repository
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="linux-installation-rpm.html">
         2.5.4 Installing MySQL on Linux Using RPM Packages from Oracle
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="linux-installation-debian.html">
         2.5.5 Installing MySQL on Linux Using Debian Packages from Oracle
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="linux-installation-docker.html">
         2.5.6 Deploying MySQL on Linux with Docker Containers
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="linux-installation-native.html">
         2.5.7 Installing MySQL on Linux from the Native Software Repositories
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="linux-installation-juju.html">
         2.5.8 Installing MySQL on Linux with Juju
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="using-systemd.html">
         2.5.9 Managing MySQL Server with systemd
        </a>
       </span>
      </dt>
     </dl>
    </dd>
    <dt>
     <span class="section">
      <a href="uln-installation.html">
       2.6 Installing MySQL Using Unbreakable Linux Network (ULN)
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="solaris-installation.html">
       2.7 Installing MySQL on Solaris
      </a>
     </span>
    </dt>
    <dd>
     <dl>
      <dt>
       <span class="section">
        <a href="solaris-installation-pkg.html">
         2.7.1 Installing MySQL on Solaris Using a Solaris PKG
        </a>
       </span>
      </dt>
     </dl>
    </dd>
    <dt>
     <span class="section">
      <a href="source-installation.html">
       2.8 Installing MySQL from Source
      </a>
     </span>
    </dt>
    <dd>
     <dl>
      <dt>
       <span class="section">
        <a href="source-installation-methods.html">
         2.8.1 Source Installation Methods
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="source-installation-prerequisites.html">
         2.8.2 Source Installation Prerequisites
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="source-installation-layout.html">
         2.8.3 MySQL Layout for Source Installation
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="installing-source-distribution.html">
         2.8.4 Installing MySQL Using a Standard Source Distribution
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="installing-development-tree.html">
         2.8.5 Installing MySQL Using a Development Source Tree
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="source-ssl-library-configuration.html">
         2.8.6 Configuring SSL Library Support
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="source-configuration-options.html">
         2.8.7 MySQL Source-Configuration Options
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="compilation-problems.html">
         2.8.8 Dealing with Problems Compiling MySQL
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="source-configuration-third-party.html">
         2.8.9 MySQL Configuration and Third-Party Tools
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="source-installation-doxygen.html">
         2.8.10 Generating MySQL Doxygen Documentation Content
        </a>
       </span>
      </dt>
     </dl>
    </dd>
    <dt>
     <span class="section">
      <a href="postinstallation.html">
       2.9 Postinstallation Setup and Testing
      </a>
     </span>
    </dt>
    <dd>
     <dl>
      <dt>
       <span class="section">
        <a href="data-directory-initialization.html">
         2.9.1 Initializing the Data Directory
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="starting-server.html">
         2.9.2 Starting the Server
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="testing-server.html">
         2.9.3 Testing the Server
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="default-privileges.html">
         2.9.4 Securing the Initial MySQL Account
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="automatic-start.html">
         2.9.5 Starting and Stopping MySQL Automatically
        </a>
       </span>
      </dt>
     </dl>
    </dd>
    <dt>
     <span class="section">
      <a href="perl-support.html">
       2.10 Perl Installation Notes
      </a>
     </span>
    </dt>
    <dd>
     <dl>
      <dt>
       <span class="section">
        <a href="perl-installation.html">
         2.10.1 Installing Perl on Unix
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="activestate-perl.html">
         2.10.2 Installing ActiveState Perl on Windows
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="perl-support-problems.html">
         2.10.3 Problems Using the Perl DBI/DBD Interface
        </a>
       </span>
      </dt>
     </dl>
    </dd>
   </dl>
  </div>
  <a class="indexterm" name="idm46045333064112">
  </a>
  <p>
   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
   <a class="xref" href="upgrading.html" title="Chapter 3 Upgrading MySQL">
    Chapter 3,
    <i>
     Upgrading MySQL
    </i>
   </a>
   , for information about upgrade
    procedures and about issues that you should consider before
    upgrading.
  </p>
  <p>
   If you are interested in migrating to MySQL from another database
    system, see
   <a class="xref" href="faqs-migration.html" title="A.8 MySQL 8.4 FAQ: Migration">
    Section A.8, “MySQL 8.4 FAQ: Migration”
   </a>
   , which contains answers
    to some common questions concerning migration issues.
  </p>
  <p>
   Installation of MySQL generally follows the steps outlined here:
  </p>
  <div class="orderedlist">
   <ol class="orderedlist" type="1">
    <li class="listitem">
     <p>
      <span class="bold">
       <strong>
        Determine whether MySQL runs and is
        supported on your platform.
       </strong>
      </span>
     </p>
     <p>
      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
      <a class="ulink" href="https://www.mysql.com/support/supportedplatforms/database.html" target="_blank">
       https://www.mysql.com/support/supportedplatforms/database.html
      </a>
      on the MySQL
        website.
     </p>
    </li>
    <li class="listitem">
     <p>
      <span class="bold">
       <strong>
        Choose which track to install.
       </strong>
      </span>
     </p>
     <p>
      MySQL offers an
      <a class="link" href="glossary.html#glos_lts_series" title="LTS Series">
       LTS
        series
      </a>
      , such as MySQL 8.4, and an
      <a class="link" href="glossary.html#glos_innovation_series" title="Innovation Series">
       Innovation series
      </a>
      .
        They address different use cases as described at
      <a class="xref" href="mysql-releases.html" title="1.3 MySQL Releases: Innovation and LTS">
       Section 1.3, “MySQL Releases: Innovation and LTS”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <span class="bold">
       <strong>
        Choose which distribution to
        install.
       </strong>
      </span>
     </p>
     <p>
      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
      <a class="xref" href="which-version.html" title="2.1.2 Which MySQL Version and Distribution to Install">
       Section 2.1.2, “Which MySQL Version and Distribution to Install”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <span class="bold">
       <strong>
        Download the distribution that you want to
        install.
       </strong>
      </span>
     </p>
     <p>
      For instructions, see
      <a class="xref" href="getting-mysql.html" title="2.1.3 How to Get MySQL">
       Section 2.1.3, “How to Get MySQL”
      </a>
      . To verify
        the integrity of the distribution, use the instructions in
      <a class="xref" href="verifying-package-integrity.html" title="2.1.4 Verifying Package Integrity Using MD5 Checksums or GnuPG">
       Section 2.1.4, “Verifying Package Integrity Using MD5 Checksums or GnuPG”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <span class="bold">
       <strong>
        Install the distribution.
       </strong>
      </span>
     </p>
     <p>
      To install MySQL from a binary distribution, use the
        instructions in
      <a class="xref" href="binary-installation.html" title="2.2 Installing MySQL on Unix/Linux Using Generic Binaries">
       Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”
      </a>
      .
        Alternatively, use the
      <a class="ulink" href="/doc/mysql-secure-deployment-guide/en/" target="_top">
       Secure
        Deployment Guide
      </a>
      , which provides procedures for
        deploying a generic binary distribution of MySQL Enterprise Edition Server with
        features for managing the security of your MySQL installation.
     </p>
     <p>
      To install MySQL from a source distribution or from the current
        development source tree, use the instructions in
      <a class="xref" href="source-installation.html" title="2.8 Installing MySQL from Source">
       Section 2.8, “Installing MySQL from Source”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <span class="bold">
       <strong>
        Perform any necessary postinstallation
        setup.
       </strong>
      </span>
     </p>
     <p>
      After installing MySQL, see
      <a class="xref" href="postinstallation.html" title="2.9 Postinstallation Setup and Testing">
       Section 2.9, “Postinstallation Setup and Testing”
      </a>
      ,
        for information about making sure the MySQL server is working
        properly. Also refer to the information provided in
      <a class="xref" href="default-privileges.html" title="2.9.4 Securing the Initial MySQL Account">
       Section 2.9.4, “Securing the Initial MySQL Account”
      </a>
      . This section describes how
        to secure the initial MySQL
      <code class="literal">
       root
      </code>
      user
        account,
      <span class="emphasis">
       <em>
        which has no password until you assign
        one
       </em>
      </span>
      . The section applies whether you install MySQL
        using a binary or source distribution.
     </p>
    </li>
    <li class="listitem">
     <p>
      If you want to run the MySQL benchmark scripts, Perl support for
        MySQL must be available. See
      <a class="xref" href="perl-support.html" title="2.10 Perl Installation Notes">
       Section 2.10, “Perl Installation Notes”
      </a>
      .
     </p>
    </li>
   </ol>
  </div>
  <p>
   Instructions for installing MySQL on different platforms and
    environments is available on a platform by platform basis:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <span class="bold">
       <strong>
        Unix, Linux
       </strong>
      </span>
     </p>
     <p>
      For instructions on installing MySQL on most Linux and Unix
        platforms using a generic binary (for example, a
      <code class="filename">
       .tar.gz
      </code>
      package), see
      <a class="xref" href="binary-installation.html" title="2.2 Installing MySQL on Unix/Linux Using Generic Binaries">
       Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”
      </a>
      .
     </p>
     <p>
      For information on building MySQL entirely from the source code
        distributions or the source code repositories, see
      <a class="xref" href="source-installation.html" title="2.8 Installing MySQL from Source">
       Section 2.8, “Installing MySQL from Source”
      </a>
     </p>
     <p>
      For specific platform help on installation, configuration, and
        building from source see the corresponding platform section:
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         Linux, including notes on distribution specific methods, see
         <a class="xref" href="linux-installation.html" title="2.5 Installing MySQL on Linux">
          Section 2.5, “Installing MySQL on Linux”
         </a>
         .
        </p>
       </li>
       <li class="listitem">
        <p>
         IBM AIX, see
         <a class="xref" href="solaris-installation.html" title="2.7 Installing MySQL on Solaris">
          Section 2.7, “Installing MySQL on Solaris”
         </a>
         .
        </p>
       </li>
      </ul>
     </div>
    </li>
    <li class="listitem">
     <p>
      <span class="bold">
       <strong>
        Microsoft Windows
       </strong>
      </span>
     </p>
     <p>
      For instructions on installing MySQL on Microsoft Windows, using
        either the MSI installer or Zipped binary, see
      <a class="xref" href="windows-installation.html" title="2.3 Installing MySQL on Microsoft Windows">
       Section 2.3, “Installing MySQL on Microsoft Windows”
      </a>
      .
     </p>
     <p>
      For details and instructions on building MySQL from source code,
        see
      <a class="xref" href="source-installation.html" title="2.8 Installing MySQL from Source">
       Section 2.8, “Installing MySQL from Source”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <span class="bold">
       <strong>
        macOS
       </strong>
      </span>
     </p>
     <p>
      For installation on macOS, including using both the binary
        package and native PKG formats, see
      <a class="xref" href="macos-installation.html" title="2.4 Installing MySQL on macOS">
       Section 2.4, “Installing MySQL on macOS”
      </a>
      .
     </p>
     <p>
      For information on making use of an macOS Launch Daemon to
        automatically start and stop MySQL, see
      <a class="xref" href="macos-installation-launchd.html" title="2.4.3 Installing and Using the MySQL Launch Daemon">
       Section 2.4.3, “Installing and Using the MySQL Launch Daemon”
      </a>
      .
     </p>
     <p>
      For information on the MySQL Preference Pane, see
      <a class="xref" href="macos-installation-prefpane.html" title="2.4.4 Installing and Using the MySQL Preference Pane">
       Section 2.4.4, “Installing and Using the MySQL Preference Pane”
      </a>
      .
     </p>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
