<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="linux-installation-apt-repo">
      </a>
      2.5.2 Installing MySQL on Linux Using the MySQL APT Repository
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045331262624">
  </a>
  <a class="indexterm" name="idm46045331261136">
  </a>
  <p>
   This section provides guidance on installing MySQL using the MySQL
    APT repository.
  </p>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="apt-repo-fresh-install">
       </a>
       Steps for a Fresh Installation of MySQL
      </h4>
     </div>
    </div>
   </div>
   <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
    <div class="admon-title">
     Note
    </div>
    <p>
     The following instructions assume that no version of MySQL
        (whether distributed by Oracle or other parties) has already
        been installed on your system; if that is not the case, follow
        the instructions given in
     <a class="xref" href="linux-installation-apt-repo.html#repo-qg-apt-replacing" title="Replacing a Native Distribution of MySQL Using the MySQL APT Repository">
      Replacing a Native Distribution of MySQL Using the MySQL APT Repository
     </a>
     or
     <a class="xref" href="linux-installation-apt-repo.html#repo-qg-apt-replace-direct" title="Replacing a MySQL Server Installed by a Direct deb Package Download">
      Replacing a MySQL Server Installed by a Direct deb Package Download
     </a>
     instead.
    </p>
   </div>
   <p>
    <a name="apt-repo-setup">
    </a>
    <b>
     Adding the MySQL Apt Repository.
    </b>
    First, add the MySQL APT repository to your system's software
        repository list. Follow these steps:
   </p>
   <div class="orderedlist">
    <ol class="orderedlist" type="1">
     <li class="listitem">
      <p>
       Go to the download page for the MySQL APT repository at
       <a class="ulink" href="https://dev.mysql.com/downloads/repo/apt/" target="_top">
        https://dev.mysql.com/downloads/repo/apt/
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       Select and download the release package for your Linux
          distribution.
      </p>
      <p>
       Although this is not required for each update, it does update
          MySQL repository information to include the current
          information, which includes adding a new LTS series.
      </p>
     </li>
     <li class="listitem">
      <p>
       Install the downloaded release package with the following
          command, replacing
       <em class="replaceable">
        <code>
         version-specific-package-name
        </code>
       </em>
       with
          the name of the downloaded package (preceded by its path, if
          you are not running the command inside the folder where the
          package is):
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa28240030"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> dpkg <span class="token property">-i</span> <em class="replaceable">/PATH/version-specific-package-name</em><span class="token punctuation">.</span>deb</code></pre>
      </div>
      <p>
       For example, for version
       <em class="replaceable">
        <code>
         w.x.y-z
        </code>
       </em>
       of
          the package, the command is:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa72126332"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> dpkg <span class="token property">-i</span> mysql-apt-config_<em class="replaceable">w<span class="token punctuation">.</span>x<span class="token punctuation">.</span>y-z</em>_all<span class="token punctuation">.</span>deb</code></pre>
      </div>
      <p>
       Note that the same package works on all supported Debian and
          Ubuntu platforms.
      </p>
     </li>
     <li class="listitem">
      <p>
       During the installation of the package, you will be asked to
          choose the versions of the MySQL server and other components
          (for example, the MySQL Workbench) that you want to install.
          If you are not sure which version to choose, do not change the
          default options selected for you. You can also choose
       <span class="guilabel">
        none
       </span>
       if you do not want a particular
          component to be installed. After making the choices for all
          components, choose
       <span class="guilabel">
        Ok
       </span>
       to finish the
          configuration and installation of the release package.
      </p>
      <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
       <div class="admon-title">
        Note
       </div>
       <p>
        The innovation track, which begins with MySQL 8.1, includes
            "-innovation-" in the component name.
       </p>
      </div>
      <p>
       You can always change your choices for the versions later; see
       <a class="xref" href="linux-installation-apt-repo.html#repo-qg-apt-select-series" title="Selecting a Major Release Version">
        Selecting a Major Release Version
       </a>
       for instructions.
      </p>
     </li>
     <li class="listitem">
      <p>
       Update package information from the MySQL APT repository with
          the following command (
       <span class="emphasis">
        <em>
         this step is
          mandatory
        </em>
       </span>
       ):
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa46748109"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get update</code></pre>
      </div>
     </li>
    </ol>
   </div>
   <p>
    Instead of using the release package, you can also add and
      configure the MySQL APT repository manually; see
    <a class="xref" href="linux-installation-apt-repo.html#repo-qg-apt-repo-manual-setup" title="Appendix A: Adding and Configuring the MySQL APT Repository Manually">
     Appendix A: Adding and Configuring the MySQL APT Repository Manually
    </a>
    for details.
   </p>
   <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
    <div class="admon-title">
     Note
    </div>
    <p>
     Once the MySQL APT repository is enabled on your system, you
        will no longer be able to install any MySQL packages from your
        platform's native software repositories until the MySQL APT
        repository is disabled.
    </p>
   </div>
   <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
    <div class="admon-title">
     Note
    </div>
    <p>
     Once the MySQL APT repository is enabled on your system, any
        system-wide upgrade by the
     <span class="command">
      <strong>
       apt-get upgrade
      </strong>
     </span>
     command will automatically upgrade the MySQL packages on your
        system and also replace any native MySQL packages you installed
        from your Linux distribution's software repository, if APT finds
        replacements for them from within the MySQL APT repository.
    </p>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="repo-qg-apt-select-series">
       </a>
       Selecting a Major Release Version
      </h4>
     </div>
    </div>
   </div>
   <p>
    By default, all installations and upgrades for your MySQL server
      and the other required components come from the release series of
      the major version you have selected during the installation of the
      configuration package (see
    <a class="xref" href="linux-installation-apt-repo.html#apt-repo-setup" title="Adding the MySQL Apt Repository">
     Adding the MySQL Apt Repository
    </a>
    ).
      However, you can switch to another supported major release series
      at any time by reconfiguring the configuration package you have
      installed. Use the following command:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa81673278"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> dpkg-reconfigure mysql-apt-config</code></pre>
   </div>
   <p>
    A dialogue box then asks you to choose the major release version
      you want. Make your selection and choose
    <span class="guilabel">
     Ok
    </span>
    .
      After returning to the command prompt, update package information
      from the MySQL APT repository with this command:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa20863362"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get update</code></pre>
   </div>
   <p>
    The latest version in the selected series will then be installed
      when you use the
    <span class="command">
     <strong>
      apt-get install
     </strong>
    </span>
    command next
      time.
   </p>
   <p>
    You can use the same method to change the version for any other
      MySQL component you want to install with the MySQL APT repository.
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="repo-qg-apt-installing">
       </a>
       Installing MySQL with APT
      </h4>
     </div>
    </div>
   </div>
   <p>
    Install MySQL by the following command:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa53448850"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get install mysql-server</code></pre>
   </div>
   <p>
    This installs the package for the MySQL server, as well as the
      packages for the client and for the database common files.
   </p>
   <p>
    During the installation, you are asked to supply a password for
      the root user for your MySQL installation.
   </p>
   <p>
   </p>
   <div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
    <div class="admon-title">
     Important
    </div>
    <p>
     Make sure you remember the root password you set. Users who
          want to set a password later can leave the
     <span class="guilabel">
      password
     </span>
     field blank in the dialogue box
          and just press
     <span class="guilabel">
      Ok
     </span>
     ; in that case, root
          access to the server will be authenticated by
     <a class="xref" href="socket-pluggable-authentication.html" title="8.4.1.10 Socket Peer-Credential Pluggable Authentication">
      Section 8.4.1.10, “Socket Peer-Credential Pluggable Authentication”
     </a>
     for
          connections using a Unix socket file. You can set the root
          password later using the program
     <a class="link" href="mysql-secure-installation.html" title="6.4.2 mysql_secure_installation — Improve MySQL Installation Security">
      <span class="command">
       <strong>
        mysql_secure_installation
       </strong>
      </span>
     </a>
     .
    </p>
   </div>
   <p>
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="repo-qg-apt-starting-and-stopping-server">
       </a>
       Starting and Stopping the MySQL Server
      </h4>
     </div>
    </div>
   </div>
   <p>
    The MySQL server is started automatically after installation. You
      can check the status of the MySQL server with the following
      command:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa97474173"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">systemctl</span> status mysql</code></pre>
   </div>
   <p>
   </p>
   <p>
    If the operating system is systemd enabled, standard
    <span class="command">
     <strong>
      systemctl
     </strong>
    </span>
    (or alternatively,
    <span class="command">
     <strong>
      service
     </strong>
    </span>
    with the arguments reversed) commands
      such as
    <span class="command">
     <strong>
      stop
     </strong>
    </span>
    ,
    <span class="command">
     <strong>
      start
     </strong>
    </span>
    ,
    <span class="command">
     <strong>
      status
     </strong>
    </span>
    , and
    <a class="link" href="restart.html" title="15.7.8.8 RESTART Statement">
     <span class="command">
      <strong>
       restart
      </strong>
     </span>
    </a>
    should
      be used to manage the MySQL server service. The
    <code class="literal">
     mysql
    </code>
    service is enabled by default, and it
      starts at system reboot. See
    <a class="xref" href="using-systemd.html" title="2.5.9 Managing MySQL Server with systemd">
     Section 2.5.9, “Managing MySQL Server with systemd”
    </a>
    for
      additional information.
   </p>
   <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
    <div class="admon-title">
     Note
    </div>
    <p>
     A few third-party native repository packages that have
        dependencies on the native MySQL packages may not work with the
        MySQL APT repository packages and should not be used together
        with them; these include akonadi-backend-mysql,
        handlersocket-mysql-5.5, and zoneminder.
    </p>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="apt-repo-install-components">
       </a>
       Installing Additional MySQL Products and Components with APT
      </h4>
     </div>
    </div>
   </div>
   <p>
    You can use APT to install individual components of MySQL from the
      MySQL APT repository. Assuming you already have the MySQL APT
      repository on your system's repository list (see
    <a class="xref" href="linux-installation-apt-repo.html#apt-repo-setup" title="Adding the MySQL Apt Repository">
     Adding the MySQL Apt Repository
    </a>
    for instructions), first, use the
      following command to get the latest package information from the
      MySQL APT repository:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa77024338"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get update</code></pre>
   </div>
   <p>
    Install any packages of your choice with the following command,
      replacing
    <em class="replaceable">
     <code>
      package-name
     </code>
    </em>
    with name of the
      package to install:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa1431099"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get install <em class="replaceable">package-name</em></code></pre>
   </div>
   <p>
    For example, to install the MySQL Workbench:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa31908770"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get install mysql-workbench-community</code></pre>
   </div>
   <p>
    To install the shared client libraries:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa38793543"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get install libmysqlclient21</code></pre>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="repo-qp-apt-install-from-source">
       </a>
       Installing MySQL from Source with the MySQL APT Repository
      </h4>
     </div>
    </div>
   </div>
   <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
    <div class="admon-title">
     Note
    </div>
    <p>
     This feature is only supported on 64-bit systems.
    </p>
   </div>
   <p>
    You can download the source code for MySQL and build it using the
      MySQL APT Repository:
   </p>
   <div class="orderedlist">
    <ol class="orderedlist" type="1">
     <li class="listitem">
      <p>
       Add the MySQL APT repository to your system's repository list
          and choose the major release series you want (see
       <a class="xref" href="linux-installation-apt-repo.html#apt-repo-setup" title="Adding the MySQL Apt Repository">
        Adding the MySQL Apt Repository
       </a>
       for instructions).
      </p>
     </li>
     <li class="listitem">
      <p>
       Update package information from the MySQL APT repository with
          the following command (
       <span class="emphasis">
        <em>
         this step is
          mandatory
        </em>
       </span>
       ):
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa78960407"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get update</code></pre>
      </div>
     </li>
     <li class="listitem">
      <p>
       Install packages that the build process depends on:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa99788003"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get build-dep mysql-server</code></pre>
      </div>
      <p>
      </p>
     </li>
     <li class="listitem">
      <p>
       Download the source code for the major components of MySQL and
          then build them (run this command in the folder in which you
          want the downloaded files and the builds to be located):
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa77513134"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">apt-get</span> source <span class="token property">-b</span> mysql-server</code></pre>
      </div>
      <p>
       <code class="filename">
        deb
       </code>
       packages for installing the various
          MySQL components are created.
      </p>
     </li>
     <li class="listitem">
      <p>
       Pick the
       <code class="filename">
        deb
       </code>
       packages for the MySQL
          components you need and install them with the command:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa80435395"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> dpkg <span class="token property">-i</span> <em class="replaceable">package-name</em><span class="token punctuation">.</span>deb</code></pre>
      </div>
      <p>
       Notice that dependency relationships exist among the MySQL
          packages. For a basic installation of the MySQL server,
          install the database common files package, the client package,
          the client metapackage, the server package, and the server
          metapackage (in that order) with the following steps:
      </p>
      <div class="itemizedlist">
       <ul class="itemizedlist" style="list-style-type: disc; ">
        <li class="listitem">
         <p>
          Preconfigure the MySQL server package with the following
                command:
         </p>
         <div class="copytoclipboard-wrapper">
          <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa11450984"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> dpkg-preconfigure mysql-community-server_<em class="replaceable">version-and-platform-specific-part</em><span class="token punctuation">.</span>deb</code></pre>
         </div>
         <p>
          You will be asked to provide a password for the root
                user for your MySQL installation; see important
                information on root password given in
          <a class="xref" href="linux-installation-apt-repo.html#repo-qg-apt-installing" title="Installing MySQL with APT">
           Installing MySQL with APT
          </a>
          above. You
                might also be asked other questions regarding the
                installation.
         </p>
        </li>
        <li class="listitem">
         <p>
          Install the required packages with a single command:
         </p>
         <div class="copytoclipboard-wrapper">
          <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa45392927"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> dpkg <span class="token property">-i</span> mysql-<span class="token punctuation">{</span>common<span class="token punctuation">,</span>community-client<span class="token punctuation">,</span>client<span class="token punctuation">,</span>community-server<span class="token punctuation">,</span>server<span class="token punctuation">}</span>_*<span class="token punctuation">.</span>deb</code></pre>
         </div>
        </li>
        <li class="listitem">
         <p>
          If you are being warned of unmet dependencies by
          <span class="command">
           <strong>
            dpkg
           </strong>
          </span>
          , you can fix them using
          <span class="command">
           <strong>
            apt-get
           </strong>
          </span>
          :
         </p>
         <div class="copytoclipboard-wrapper">
          <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa17768816"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal">sudo apt-get <span class="token property">-f</span> install</code></pre>
         </div>
        </li>
       </ul>
      </div>
      <p>
       Here are where the files are installed on the system:
      </p>
      <div class="itemizedlist">
       <ul class="itemizedlist" style="list-style-type: disc; ">
        <li class="listitem">
         <p>
          All configuration files (like
          <code class="filename">
           my.cnf
          </code>
          ) are under
          <code class="filename">
           /etc/mysql
          </code>
         </p>
        </li>
        <li class="listitem">
         <p>
          All binaries, libraries, headers, etc., are under
          <code class="filename">
           /usr/bin
          </code>
          and
          <code class="filename">
           /usr/sbin
          </code>
         </p>
        </li>
        <li class="listitem">
         <p>
          The data directory is under
          <code class="filename">
           /var/lib/mysql
          </code>
         </p>
        </li>
       </ul>
      </div>
      <p>
      </p>
     </li>
    </ol>
   </div>
   <p>
    See also information given in
    <a class="xref" href="linux-installation-apt-repo.html#repo-qg-apt-starting-and-stopping-server" title="Starting and Stopping the MySQL Server">
     Starting and Stopping the MySQL Server
    </a>
    .
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="repo-qg-apt-upgrading">
       </a>
       Upgrading MySQL with the MySQL APT Repository
      </h4>
     </div>
    </div>
   </div>
   <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
    <div class="admon-title">
     Notes
    </div>
    <div class="itemizedlist">
     <ul class="itemizedlist" style="list-style-type: disc; ">
      <li class="listitem">
       <p>
        Before performing any upgrade to MySQL, follow carefully the
            instructions in
        <a class="xref" href="upgrading.html" title="Chapter 3 Upgrading MySQL">
         Chapter 3,
         <i>
          Upgrading MySQL
         </i>
        </a>
        . Among other
            instructions discussed there,
        <span class="emphasis">
         <em>
          it is especially
            important to back up your database before the
            upgrade
         </em>
        </span>
        .
       </p>
      </li>
      <li class="listitem">
       <p>
        The following instructions assume that MySQL has been
            installed on your system using the MySQL APT repository; if
            that is not the case, follow the instructions given in
        <a class="xref" href="linux-installation-apt-repo.html#repo-qg-apt-replacing" title="Replacing a Native Distribution of MySQL Using the MySQL APT Repository">
         Replacing a Native Distribution of MySQL Using the MySQL APT Repository
        </a>
        or
        <a class="xref" href="linux-installation-apt-repo.html#repo-qg-apt-replace-direct" title="Replacing a MySQL Server Installed by a Direct deb Package Download">
         Replacing a MySQL Server Installed by a Direct deb Package Download
        </a>
        instead. Also
            notice that you cannot use the MySQL APT repository to
            upgrade a distribution of MySQL that you have installed from
            a nonnative software repository (for example, from MariaDB
            or Percona).
       </p>
      </li>
     </ul>
    </div>
   </div>
   <p>
    Use the MySQL APT repository to perform an in-place upgrade for
      your MySQL installation (that is, replacing the old version and
      then running the new version using the old data files) by
      following these steps:
   </p>
   <div class="orderedlist">
    <ol class="orderedlist" type="1">
     <li class="listitem">
      <p>
       Make sure you already have the MySQL APT repository on your
          system's repository list (see
       <a class="xref" href="linux-installation-apt-repo.html#apt-repo-setup" title="Adding the MySQL Apt Repository">
        Adding the MySQL Apt Repository
       </a>
       for instructions).
      </p>
     </li>
     <li class="listitem">
      <p>
       Make sure you have the most up-to-date package information on
          the MySQL APT repository by running:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa39373985"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get update</code></pre>
      </div>
      <p>
      </p>
     </li>
     <li class="listitem">
      <p>
       Note that, by default, the MySQL APT repository will update
          MySQL to the release series you have selected when you were
       <a class="link" href="linux-installation-apt-repo.html#apt-repo-setup" title="Adding the MySQL Apt Repository">
        adding the MySQL APT repository
          to your system
       </a>
       . If you want to upgrade to another
          release series, select it by following the steps given in
       <a class="xref" href="linux-installation-apt-repo.html#repo-qg-apt-select-series" title="Selecting a Major Release Version">
        Selecting a Major Release Version
       </a>
       .
      </p>
      <p>
       As a general rule, to upgrade from one release series to
          another, go to the next series rather than skipping a series.
          For example, if you are currently running MySQL 5.7 and wish
          to upgrade to a newer series, upgrade to MySQL 8.0 first
          before upgrading to 8.4.
      </p>
      <div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
       <div class="admon-title">
        Important
       </div>
       <p>
        In-place downgrading of MySQL is not supported by the
              MySQL APT repository. Follow the instructions in
        <a class="xref" href="downgrading.html" title="Chapter 4 Downgrading MySQL">
         Chapter 4,
         <i>
          Downgrading MySQL
         </i>
        </a>
        .
       </p>
      </div>
      <p>
      </p>
     </li>
     <li class="listitem">
      <p>
       <a name="apt-repo-upgrade-step4">
       </a>
       Upgrade MySQL by the following command:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa7407432"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get install mysql-server</code></pre>
      </div>
      <p>
       The MySQL server, client, and the database common files are
          upgraded if newer versions are available. To upgrade any other
          MySQL package, use the same
       <span class="command">
        <strong>
         apt-get install
        </strong>
       </span>
       command and supply the name for the package you want to
          upgrade:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa31871417"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get install <em class="replaceable">package-name</em></code></pre>
      </div>
      <p>
       To see the names of the packages you have installed from the
          MySQL APT repository, use the following command:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa84827827"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">dpkg</span> <span class="token property">-l</span> | grep mysql | grep ii</code></pre>
      </div>
      <p>
      </p>
      <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
       <div class="admon-title">
        Note
       </div>
       <p>
        If you perform a system-wide upgrade using
        <span class="command">
         <strong>
          apt-get
            upgrade
         </strong>
        </span>
        , only the MySQL library and development
            packages are upgraded with newer versions (if available). To
            upgrade other components including the server, client, test
            suite, etc., use the
        <span class="command">
         <strong>
          apt-get install
         </strong>
        </span>
        command.
       </p>
      </div>
     </li>
     <li class="listitem">
      <p>
       The MySQL server always restarts after an update by APT.
      </p>
     </li>
    </ol>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="repo-qg-apt-replacing">
       </a>
       Replacing a Native Distribution of MySQL Using the MySQL APT Repository
      </h4>
     </div>
    </div>
   </div>
   <p>
    Variants and forks of MySQL are distributed by different parties
      through their own software repositories or download sites. You can
      replace a native distribution of MySQL installed from your Linux
      platform's software repository with a distribution from the MySQL
      APT repository in a few steps.
   </p>
   <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
    <div class="admon-title">
     Note
    </div>
    <p>
     The MySQL APT repository can only replace distributions of MySQL
        maintained and distributed by Debian or Ubuntu. It cannot
        replace any MySQL forks found either inside or outside of the
        distributions' native repositories. To replace such MySQL forks,
        you have to uninstall them first before you install MySQL using
        the MySQL APT repository. Follow the instructions for
        uninstallation from the forks' distributors and, before you
        proceed, make sure you back up your data and you know how to
        restore them to a new server.
    </p>
   </div>
   <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
    <div class="admon-title">
     Warning
    </div>
    <p>
     A few third-party native repository packages that have
        dependencies on the native MySQL packages may not work with the
        MySQL APT repository packages and should not be used together
        with them; these include akonadi-backend-mysql,
        handlersocket-mysql-5.5, and zoneminder.
    </p>
   </div>
   <div class="orderedlist">
    <ol class="orderedlist" type="1">
     <li class="listitem">
      <h5>
       <a name="idm46045331115728">
       </a>
       Backing Up Your Database
      </h5>
      <p>
       To avoid loss of data, always back up your database before
          trying to replace your MySQL installation using the MySQL APT
          repository. See
       <a class="xref" href="backup-and-recovery.html" title="Chapter 9 Backup and Recovery">
        Chapter 9,
        <i>
         Backup and Recovery
        </i>
       </a>
       for
          instructions.
      </p>
     </li>
     <li class="listitem">
      <h5>
       <a name="idm46045331113328">
       </a>
       Adding the MySQL APT Repository and Selecting a Release Series
      </h5>
      <p>
       Add the MySQL APT repository to your system's repository list
          and select the release series you want by following the
          instructions given in
       <a class="xref" href="linux-installation-apt-repo.html#apt-repo-setup" title="Adding the MySQL Apt Repository">
        Adding the MySQL Apt Repository
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <h5>
       <a name="repo-qg-apt-replace-native">
       </a>
       Replacing the Native Distribution by an APT Update
      </h5>
      <p>
       By design, the MySQL APT repository replaces your native
          distribution of MySQL when you perform upgrades on the MySQL
          packages. To perform the upgrades, follow the same
          instructions given in
       <a class="link" href="linux-installation-apt-repo.html#apt-repo-upgrade-step4">
        Step 4
       </a>
       in
       <a class="xref" href="linux-installation-apt-repo.html#repo-qg-apt-upgrading" title="Upgrading MySQL with the MySQL APT Repository">
        Upgrading MySQL with the MySQL APT Repository
       </a>
       .
      </p>
     </li>
    </ol>
   </div>
   <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
    <div class="admon-title">
     Warning
    </div>
    <p>
     Once the native distribution of MySQL has been replaced using
        the MySQL APT repository, purging the old MySQL packages from
        the native repository using the
     <span class="command">
      <strong>
       apt-get
        purge
      </strong>
     </span>
     ,
     <span class="command">
      <strong>
       apt-get remove --purge
      </strong>
     </span>
     , or
     <span class="command">
      <strong>
       dpkg -P
      </strong>
     </span>
     command might impact the newly
        installed MySQL server in various ways. Therefore,
     <span class="emphasis">
      <em>
       do
        not purge the old MySQL packages from the native repository
        packages
      </em>
     </span>
     .
    </p>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="repo-qg-apt-replace-direct">
       </a>
       Replacing a MySQL Server Installed by a Direct deb Package Download
      </h4>
     </div>
    </div>
   </div>
   <p>
    <code class="filename">
     deb
    </code>
    packages from MySQL for installing the
      MySQL server and its components can either be downloaded from the
    <a class="ulink" href="https://dev.mysql.com/downloads/" target="_top">
     MySQL Developer Zone's MySQL
      Download page
    </a>
    or from the MySQL APT repository. The
    <code class="filename">
     deb
    </code>
    packages from the two sources are
      different, and they install and configure MySQL in different ways.
   </p>
   <p>
    If you have installed MySQL with the MySQL Developer Zone's
    <code class="filename">
     deb
    </code>
    packages and now want to replace the
      installation using the ones from the MySQL APT repository, follow
      these steps:
   </p>
   <div class="orderedlist">
    <ol class="orderedlist" type="1">
     <li class="listitem">
      <p>
       Back up your database. See
       <a class="xref" href="backup-and-recovery.html" title="Chapter 9 Backup and Recovery">
        Chapter 9,
        <i>
         Backup and Recovery
        </i>
       </a>
       for instructions.
      </p>
     </li>
     <li class="listitem">
      <p>
       Follow the steps given previously for
       <a class="link" href="linux-installation-apt-repo.html#apt-repo-setup" title="Adding the MySQL Apt Repository">
        adding the MySQL APT
          repository
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       Remove the old installation of MySQL by running:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa91306310"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> dpkg <span class="token property">-P</span> mysql</code></pre>
      </div>
      <p>
      </p>
     </li>
     <li class="listitem">
      <p>
       Install MySQL from the MySQL APT repository:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa72856576"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get install mysql-server</code></pre>
      </div>
      <p>
      </p>
     </li>
     <li class="listitem">
      <p>
       If needed, restore the data on the new MySQL installation. See
       <a class="xref" href="backup-and-recovery.html" title="Chapter 9 Backup and Recovery">
        Chapter 9,
        <i>
         Backup and Recovery
        </i>
       </a>
       for instructions.
      </p>
     </li>
    </ol>
   </div>
   <h5>
    <a name="apt-repo-remove">
    </a>
    Removing MySQL with APT
   </h5>
   <p>
    To uninstall the MySQL server and the related components that have
      been installed using the MySQL APT repository, first, remove the
      MySQL server using the following command:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa96360370"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get remove mysql-server</code></pre>
   </div>
   <p>
    Then, remove any other software that was installed automatically
      with the MySQL server:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa86234803"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get autoremove</code></pre>
   </div>
   <p>
    To uninstall other components, use the following command,
      replacing
    <strong class="userinput">
     <code>
      package-name
     </code>
    </strong>
    with the name of the
      package of the component you want to remove:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa56401643"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get remove <em class="replaceable">package-name</em></code></pre>
   </div>
   <p>
    To see a list of packages you have installed from the MySQL APT
      repository, use the following command:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa79802222"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">dpkg</span> <span class="token property">-l</span> | grep mysql | grep ii</code></pre>
   </div>
   <h5>
    <a name="updating-apt-repo-client-lib">
    </a>
    Special Notes on Upgrading the Shared Client Libraries
   </h5>
   <p>
    You can install the shared client libraries from MySQL APT
      repository by the following command (see
    <a class="xref" href="linux-installation-apt-repo.html#apt-repo-install-components" title="Installing Additional MySQL Products and Components with APT">
     Installing Additional MySQL Products and Components with APT
    </a>
    for more details):
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa28082218"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get install libmysqlclient21</code></pre>
   </div>
   <p>
    If you already have the shared client libraries installed from you
      Linux platform's software repository, it can be updated by the
      MySQL APT repository with its own package by using the same
      command (see
    <a class="xref" href="linux-installation-apt-repo.html#repo-qg-apt-replace-native" title="Replacing the Native Distribution by an APT Update">
     Replacing the Native Distribution by an APT Update
    </a>
    for more
      details).
   </p>
   <p>
    After updating MySQL using the APT repository, applications
      compiled with older versions of the shared client libraries should
      continue to work.
   </p>
   <p>
    <span class="emphasis">
     <em>
      If you recompile applications and dynamically link them
      with the updated libraries:
     </em>
    </span>
    as typical with new
      versions of shared libraries, any applications compiled using the
      updated, newer shared libraries might require those updated
      libraries on systems where the applications are deployed. If those
      libraries are not in place, the applications requiring the shared
      libraries might fail. Therefore, it is recommended that the
      packages for the shared libraries from MySQL be deployed on those
      systems. You can do this by adding the MySQL APT repository to the
      systems (see
    <a class="xref" href="linux-installation-apt-repo.html#apt-repo-setup" title="Adding the MySQL Apt Repository">
     Adding the MySQL Apt Repository
    </a>
    ) and installing the
      latest shared client libraries using the command given at the
      beginning of this section.
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="repo-qg-apt-cluster-install">
       </a>
       Installing MySQL NDB Cluster Using the APT Repository
      </h4>
     </div>
    </div>
   </div>
   <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
    <div class="admon-title">
     Notes
    </div>
    <div class="itemizedlist">
     <ul class="itemizedlist" style="list-style-type: disc; ">
      <li class="listitem">
       <p>
        The MySQL APT repository supports installation of MySQL NDB Cluster on
            Debian and Ubuntu systems. For methods to install NDB Cluster on
            other Debian-based systems, see
        <a class="ulink" href="/doc/refman/5.7/en/mysql-cluster-install-debian.html" target="_top">
         Installing NDB Cluster Using .deb Files
        </a>
        .
       </p>
      </li>
      <li class="listitem">
       <p>
        If you already have the MySQL server or MySQL NDB Cluster installed on
            your system, make sure it is stopped and you have your data
            and configuration files backed up before proceeding.
       </p>
      </li>
     </ul>
    </div>
   </div>
   <div class="orderedlist">
    <ol class="orderedlist" type="1">
     <li class="listitem">
      <h5>
       <a name="apt-repo-setup-cluster">
       </a>
       Adding the MySQL APT Repository for MySQL NDB Cluster
      </h5>
      <p>
       Follow the steps in
       <a class="xref" href="linux-installation-apt-repo.html#apt-repo-setup" title="Adding the MySQL Apt Repository">
        Adding the MySQL Apt Repository
       </a>
       to add
          the MySQL APT repository to your system's repository list.
          During the installation process of the configuration package,
          when you are asked which MySQL product you want to configure,
          choose
       <span class="quote">
        “
        <span class="quote">
         MySQL Server &amp; Cluster
        </span>
        ”
       </span>
       ; when asked
          which version you wish to receive, choose
       <span class="quote">
        “
        <span class="quote">
         mysql-cluster-
         <em class="replaceable">
          <code>
           x
          </code>
         </em>
         .
         <em class="replaceable">
          <code>
           y
          </code>
         </em>
         .
        </span>
        ”
       </span>
       After returning to the command prompt, go to Step 2 below.
      </p>
      <p>
       If you already have the configuration package installed on
          your system, make sure it is up-to-date by running the
          following command:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa30244396"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get install mysql-apt-config</code></pre>
      </div>
      <p>
       Then, use the same method described in
       <a class="xref" href="linux-installation-apt-repo.html#repo-qg-apt-select-series" title="Selecting a Major Release Version">
        Selecting a Major Release Version
       </a>
       to select MySQL NDB Cluster
          for installation. When you are asked which MySQL product you
          want to configure, choose
       <span class="quote">
        “
        <span class="quote">
         MySQL Server &amp;
          Cluster
        </span>
        ”
       </span>
       ; when asked which version you wish to receive,
          choose
       <span class="quote">
        “
        <span class="quote">
         mysql-cluster-
         <em class="replaceable">
          <code>
           x
          </code>
         </em>
         .
         <em class="replaceable">
          <code>
           y
          </code>
         </em>
         .
        </span>
        ”
       </span>
       After returning to the command prompt, update package
          information from the MySQL APT repository with this command:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa31401997"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get update</code></pre>
      </div>
      <p>
      </p>
     </li>
     <li class="listitem">
      <h5>
       <a name="idm46045331049152">
       </a>
       Installing MySQL NDB Cluster
      </h5>
      <p>
       For a minimal installation of MySQL NDB Cluster, follow these
          steps:
      </p>
      <div class="itemizedlist">
       <ul class="itemizedlist" style="list-style-type: disc; ">
        <li class="listitem">
         <p>
          <a name="repo-qg-apt-installing-cluster-server">
          </a>
          Install the components for SQL nodes:
         </p>
         <div class="copytoclipboard-wrapper">
          <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa93121815"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get install mysql-cluster-community-server</code></pre>
         </div>
         <p>
          You will be asked to provide a password for the root user
              for your SQL node; see important information on the root
              password given in
          <a class="xref" href="linux-installation-apt-repo.html#repo-qg-apt-installing" title="Installing MySQL with APT">
           Installing MySQL with APT
          </a>
          above. You might also be asked other questions regarding
              the installation.
         </p>
        </li>
        <li class="listitem">
         <p>
          Install the executables for management nodes:
         </p>
         <div class="copytoclipboard-wrapper">
          <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa8135494"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get install mysql-cluster-community-management-server</code></pre>
         </div>
        </li>
        <li class="listitem">
         <p>
          Install the executables for data nodes:
         </p>
         <div class="copytoclipboard-wrapper">
          <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa81402745"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get install mysql-cluster-community-data-node</code></pre>
         </div>
        </li>
       </ul>
      </div>
     </li>
     <li class="listitem">
      <h5>
       <a name="idm46045331037568">
       </a>
       Configuring and Starting MySQL NDB Cluster
      </h5>
      <p>
       See
       <a class="xref" href="mysql-cluster-install-configuration.html" title="25.3.3 Initial Configuration of NDB Cluster">
        Section 25.3.3, “Initial Configuration of NDB Cluster”
       </a>
       on
          how to configure MySQL NDB Cluster and
       <a class="xref" href="mysql-cluster-install-first-start.html" title="25.3.4 Initial Startup of NDB Cluster">
        Section 25.3.4, “Initial Startup of NDB Cluster”
       </a>
       on how to
          start it for the first time. When following those
          instructions, adjust them according to the following details
          regarding the SQL nodes of your NDB Cluster installation:
      </p>
      <div class="itemizedlist">
       <ul class="itemizedlist" style="list-style-type: disc; ">
        <li class="listitem">
         <p>
          All configuration files (like
          <code class="filename">
           my.cnf
          </code>
          )
              are under
          <code class="filename">
           /etc/mysql
          </code>
         </p>
        </li>
        <li class="listitem">
         <p>
          All binaries, libraries, headers, etc., are under
          <code class="filename">
           /usr/bin
          </code>
          and
          <code class="filename">
           /usr/sbin
          </code>
         </p>
        </li>
        <li class="listitem">
         <p>
          The data directory is
          <code class="filename">
           /var/lib/mysql
          </code>
         </p>
        </li>
       </ul>
      </div>
     </li>
    </ol>
   </div>
   <h5>
    <a name="apt-repo-install-cluster-components">
    </a>
    Installing Additional MySQL NDB Cluster Products and Components
   </h5>
   <p>
    You can use APT to install individual components and additional
      products of MySQL NDB Cluster from the MySQL APT repository. To do that,
      assuming you already have the MySQL APT repository on your
      system's repository list (see
    <a class="xref" href="linux-installation-apt-repo.html#apt-repo-setup-cluster" title="Adding the MySQL APT Repository for MySQL NDB Cluster">
     Adding the MySQL Apt Repository for MySQL NDB Cluster
    </a>
    ), follow the same steps
      given in
    <a class="xref" href="linux-installation-apt-repo.html#apt-repo-install-components" title="Installing Additional MySQL Products and Components with APT">
     Installing Additional MySQL Products and Components with APT
    </a>
    .
   </p>
   <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
    <div class="admon-title">
     Note
    </div>
    <p>
     <span class="emphasis">
      <em>
       Known issue:
      </em>
     </span>
     Currently, not all
          components required for running the MySQL NDB Cluster test suite are
          installed automatically when you install the test suite
          package (
     <code class="literal">
      mysql-cluster-community-test
     </code>
     ).
          Install the following packages with
     <span class="command">
      <strong>
       apt-get
          install
      </strong>
     </span>
     before you run the test suite:
    </p>
    <div class="itemizedlist">
     <ul class="itemizedlist" style="list-style-type: disc; ">
      <li class="listitem">
       <p>
        <code class="literal">
         mysql-cluster-community-auto-installer
        </code>
       </p>
      </li>
      <li class="listitem">
       <p>
        <code class="literal">
         mysql-cluster-community-management-server
        </code>
       </p>
      </li>
      <li class="listitem">
       <p>
        <code class="literal">
         mysql-cluster-community-data-node
        </code>
       </p>
      </li>
      <li class="listitem">
       <p>
        <code class="literal">
         mysql-cluster-community-memcached
        </code>
       </p>
      </li>
      <li class="listitem">
       <p>
        <code class="literal">
         mysql-cluster-community-java
        </code>
       </p>
      </li>
      <li class="listitem">
       <p>
        <code class="literal">
         ndbclient-dev
        </code>
       </p>
      </li>
     </ul>
    </div>
   </div>
   <p>
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="repo-qg-apt-repo-manual-setup">
       </a>
       Appendix A: Adding and Configuring the MySQL APT Repository Manually
      </h4>
     </div>
    </div>
   </div>
   <p>
    Here are the steps for adding manually the MySQL APT repository to
      your system's software repository list and configuring it, without
      using the release packages provided by MySQL:
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       Download the MySQL GPG Public key (see
       <a class="xref" href="checking-gpg-signature.html" title="2.1.4.2 Signature Checking Using GnuPG">
        Section 2.1.4.2, “Signature Checking Using GnuPG”
       </a>
       on how to do that)
            and save it to a file, without adding any spaces or special
            characters. Then, add the key to your system's GPG keyring
            with the following command:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa41750964"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-key add <em class="replaceable">path/to/signature-file</em></code></pre>
      </div>
     </li>
     <li class="listitem">
      <p>
       Alternatively, you can download the GPG key to your APT
            keyring directly using the apt-key utility:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa93262093"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-key adv <span class="token property">--keyserver</span> pgp<span class="token punctuation">.</span>mit<span class="token punctuation">.</span>edu <span class="token property">--recv-keys</span> A8D3785C</code></pre>
      </div>
      <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
       <div class="admon-title">
        Note
       </div>
       <p>
        The KeyID for MySQL 8.0.36 and later release packages is
        <code class="literal">
         A8D3785C
        </code>
        , as shown above. For earlier
              MySQL releases, the keyID is
        <code class="literal">
         3A79BD29
        </code>
        .
              Using an incorrect key can cause a key verification error.
       </p>
      </div>
     </li>
     <li class="listitem">
      <p>
       Create a file named
       <code class="filename">
        /etc/apt/sources.list.d/mysql.list
       </code>
       , and
            put into it repository entries in the following format (this
            is not a command to execute):
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-simple"><div class="docs-select-all right" id="sa6224115"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-simple">deb http<span class="token operator">:</span><span class="token operator">/</span><span class="token operator">/</span>repo<span class="token punctuation">.</span>mysql<span class="token punctuation">.</span>com<span class="token operator">/</span>apt<span class="token operator">/</span><span class="token punctuation">{</span>debian<span class="token operator">|</span>ubuntu<span class="token punctuation">}</span><span class="token operator">/</span> <span class="token punctuation">{</span>bookworm<span class="token operator">|</span>jammy<span class="token punctuation">}</span> <span class="token punctuation">{</span>mysql<span class="token operator">-</span>tools<span class="token operator">|</span>mysql<span class="token operator">-</span>8<span class="token punctuation">.</span>4<span class="token operator">-</span>lts<span class="token operator">|</span>mysql<span class="token operator">-</span>8<span class="token punctuation">.</span>0<span class="token punctuation">}</span></code></pre>
      </div>
      <p>
       Pick the relevant options for your repository set up:
      </p>
      <div class="itemizedlist">
       <ul class="itemizedlist" style="list-style-type: circle; ">
        <li class="listitem">
         <p>
          Choose
          <span class="quote">
           “
           <span class="quote">
            debian
           </span>
           ”
          </span>
          or
          <span class="quote">
           “
           <span class="quote">
            ubuntu
           </span>
           ”
          </span>
          according to your platform.
         </p>
        </li>
        <li class="listitem">
         <p>
          Choose the appropriate version name for the version of
                your system; examples include
          <span class="quote">
           “
           <span class="quote">
            bookworm
           </span>
           ”
          </span>
          (for Debian 12) and
          <span class="quote">
           “
           <span class="quote">
            jammy
           </span>
           ”
          </span>
          (for Ubuntu
                22.04).
         </p>
        </li>
        <li class="listitem">
         <p>
          For installing the MySQL server, client, and database
                common files, choose
          <span class="quote">
           “
           <span class="quote">
            mysql-8.4
           </span>
           ”
          </span>
          ,
          <span class="quote">
           “
           <span class="quote">
            mysql-8.0
           </span>
           ”
          </span>
          , or
          <span class="quote">
           “
           <span class="quote">
            mysql-innovation
           </span>
           ”
          </span>
          according to the
          <a class="link" href="mysql-releases.html" title="1.3 MySQL Releases: Innovation and LTS">
           MySQL series
          </a>
          you
                want. To switch to another release series later, come
                back and adjust the entry with your new choice. This
                also includes access to tools such as MySQL Router and
                MySQL Shell.
         </p>
         <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
          <div class="admon-title">
           Note
          </div>
          <p>
           If you already have a version of MySQL installed on
                  your system, do not choose a lower version at this
                  step, or it might result in an unsupported downgrade
                  operation.
          </p>
         </div>
        </li>
        <li class="listitem">
         <p>
          Include
          <span class="quote">
           “
           <span class="quote">
            mysql-tools
           </span>
           ”
          </span>
          to install a
                connector.
         </p>
        </li>
       </ul>
      </div>
      <p>
       For example, on the Ubuntu 22.04 platform use these lines in
            your
       <code class="filename">
        mysql.list
       </code>
       files to install MySQL
            8.4 and the latest MySQL Connectors from the MySQL APT
            repository:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-simple"><div class="docs-select-all right" id="sa58080488"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-simple">deb http<span class="token operator">:</span><span class="token operator">/</span><span class="token operator">/</span>repo<span class="token punctuation">.</span>mysql<span class="token punctuation">.</span>com<span class="token operator">/</span>apt<span class="token operator">/</span>ubuntu<span class="token operator">/</span> jammy mysql<span class="token operator">-</span>8<span class="token punctuation">.</span>4 mysql<span class="token operator">-</span>tools</code></pre>
      </div>
      <p>
      </p>
     </li>
     <li class="listitem">
      <p>
       Use the following command to get the most up-to-date package
            information from the MySQL APT repository:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa8571942"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">sudo</span> apt-get update</code></pre>
      </div>
      <p>
      </p>
     </li>
    </ul>
   </div>
   <p>
   </p>
   <p>
    You have configured your system to use the MySQL APT repository
      and are now ready to continue with
    <a class="xref" href="linux-installation-apt-repo.html#repo-qg-apt-installing" title="Installing MySQL with APT">
     Installing MySQL with APT
    </a>
    or
    <a class="xref" href="linux-installation-apt-repo.html#apt-repo-install-components" title="Installing Additional MySQL Products and Components with APT">
     Installing Additional MySQL Products and Components with APT
    </a>
    .
   </p>
  </div>
 </div>
 <br/>
</div>
