<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="linux-installation-yum-repo">
      </a>
      2.5.1 Installing MySQL on Linux Using the MySQL Yum Repository
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045331416128">
  </a>
  <a class="indexterm" name="idm46045331415056">
  </a>
  <p>
   The
   <a class="ulink" href="https://dev.mysql.com/downloads/repo/yum/" target="_top">
    MySQL Yum
      repository
   </a>
   for Oracle Linux, Red Hat Enterprise Linux,
      CentOS, and Fedora provides RPM packages for installing the MySQL
      server, client, MySQL Workbench, MySQL Utilities, MySQL Router,
      MySQL Shell, Connector/ODBC, Connector/Python and so on (not all
      packages are available for all the distributions; see
   <a class="xref" href="linux-installation-yum-repo.html#yum-install-components" title="Installing Additional MySQL Products and Components with Yum">
    Installing Additional MySQL Products and Components with Yum
   </a>
   for details).
  </p>
  <h4>
   <a name="idm46045331411696">
   </a>
   Before You Start
  </h4>
  <p>
   As a popular, open-source software, MySQL, in its original or
      re-packaged form, is widely installed on many systems from various
      sources, including different software download sites, software
      repositories, and so on. The following instructions assume that
      MySQL is not already installed on your system using a
      third-party-distributed RPM package; if that is not the case,
      follow the instructions given at
   <a class="xref" href="linux-installation-yum-repo.html#linux-installation-yum-repo-replace-third-party" title="Replacing a Native Third-Party Distribution of MySQL">
    Replacing a Native Third-Party Distribution of MySQL
   </a>
   .
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    Repository setup RPM file names begin with
    <code class="literal">
     mysql84
    </code>
    , which
        describes the MySQL series that is enabled by default for
        installation. In this case, the MySQL 8.4 LTS
        subrepository is enabled by default. It also contains other
        subrepository versions, such as MySQL 8.0 and
        the MySQL Innovation Series, which are disabled by default.
   </p>
  </div>
  <h4>
   <a name="idm46045331407488">
   </a>
   Steps for a Fresh Installation of MySQL
  </h4>
  <p>
   Follow these steps to choose and install the latest MySQL
      products:
  </p>
  <div class="orderedlist">
   <ol class="orderedlist" type="1">
    <li class="listitem">
     <h4>
      <a name="yum-repo-setup">
      </a>
      Adding the MySQL Yum Repository
     </h4>
     <p>
      Add the MySQL Yum repository to your system's repository
          list. This is typically a one-time operation that is performed
          by installing the RPM provided by MySQL. Follow these steps:
     </p>
     <div class="orderedlist">
      <ol class="orderedlist" type="a">
       <li class="listitem">
        <p>
         Download it from the MySQL Yum Repository page
                (
         <a class="ulink" href="https://dev.mysql.com/downloads/repo/yum/" target="_top">
          https://dev.mysql.com/downloads/repo/yum/
         </a>
         )
                in the MySQL Developer Zone.
        </p>
       </li>
       <li class="listitem">
        <p>
         Select and download the release package for your
                platform.
        </p>
       </li>
       <li class="listitem">
        <p>
         Install the downloaded release package. The package file
                format is:
        </p>
        <div class="copytoclipboard-wrapper">
         <pre class="programlisting one-line language-simple"><div class="docs-select-all right" id="sa30517919"><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">mysql84<span class="token operator">-</span>community<span class="token operator">-</span>release<span class="token operator">-</span><span class="token punctuation"></span><em class="replaceable"><span class="token punctuation">{</span>platform<span class="token punctuation">}</span></em><span class="token punctuation"></span><span class="token operator">-</span><span class="token punctuation"></span><em class="replaceable"><span class="token punctuation">{</span>version<span class="token operator">-</span>number<span class="token punctuation">}</span></em><span class="token punctuation"></span><span class="token punctuation">.</span>noarch<span class="token punctuation">.</span>rpm</code></pre>
        </div>
        <div class="itemizedlist">
         <ul class="itemizedlist" style="list-style-type: disc; ">
          <li class="listitem">
           <p>
            <em class="replaceable">
             <code>
              mysql84
             </code>
            </em>
            :
                    Indicates the MySQL version that is enabled by
                    default. In this case, MySQL 8.4 is
                    enabled by default, and both MySQL
                    8.0 and the MySQL Innovation
                    series are available but disabled by default.
           </p>
          </li>
          <li class="listitem">
           <p>
            <em class="replaceable">
             <code>
              {platform}
             </code>
            </em>
            : The platform
                    code, such as el7, el8, el9, fc39, fc40, or fc41. The
                    'el' represents Enterprise Linux, 'fc' for Fedora,
                    and it ends with the platform's base version number.
           </p>
          </li>
          <li class="listitem">
           <p>
            <em class="replaceable">
             <code>
              {version-number}
             </code>
            </em>
            : Version
                    of the MySQL repository configuration RPM as they do
                    receive occasional updates.
           </p>
          </li>
         </ul>
        </div>
        <p>
         Install the RPM you downloaded for your system, for
                example:
        </p>
        <div class="copytoclipboard-wrapper">
         <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa91662164"><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> yum localinstall mysql84-community-release-<span class="token punctuation"></span><em class="replaceable"><span class="token punctuation">{</span>platform<span class="token punctuation">}</span></em><span class="token punctuation"></span>-<span class="token punctuation"></span><em class="replaceable"><span class="token punctuation">{</span>version-number<span class="token punctuation">}</span></em><span class="token punctuation"></span><span class="token punctuation">.</span>noarch<span class="token punctuation">.</span>rpm</code></pre>
        </div>
        <p>
         The installation command adds the MySQL Yum repository
                to your system's repository list and downloads the GnuPG
                key to check the integrity of the software packages. 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>
         for details on
                GnuPG key checking.
        </p>
        <p>
         You can check that the MySQL Yum repository has been
                successfully added and enabled by the following command
                (for dnf-enabled systems, replace
         <span class="command">
          <strong>
           yum
          </strong>
         </span>
         in the command with
         <span class="command">
          <strong>
           dnf
          </strong>
         </span>
         ):
        </p>
        <div class="copytoclipboard-wrapper">
         <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa34078240"><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">yum</span> repolist enabled | grep mysql<span class="token punctuation">.</span>*-community</code></pre>
        </div>
        <p>
        </p>
        <p>
         Example output:
        </p>
        <div class="copytoclipboard-wrapper">
         <pre class="programlisting language-none"><div class="docs-select-all right" id="sa23256464"><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-none">mysql-8.4-lts-community               MySQL 8.4 LTS Community Server
mysql-tools-8.4-lts-community            MySQL Tools 8.4 LTS Community</code></pre>
        </div>
        <p>
         This also demonstrates that the latest LTS MySQL version
                is enabled by default. Methods to choose a different
                release series, such as the innovation track (which
                today is 9.1) or a previous
                series (such as MySQL 8.0), are
                described below.
        </p>
       </li>
      </ol>
     </div>
     <p>
     </p>
     <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
      <div class="admon-title">
       Note
      </div>
      <p>
       Once the MySQL Yum repository is enabled on your system, any
            system-wide update by the
       <span class="command">
        <strong>
         yum update
        </strong>
       </span>
       command (or
       <span class="command">
        <strong>
         dnf upgrade
        </strong>
       </span>
       for dnf-enabled
            systems) upgrades MySQL packages on your system and replaces
            any native third-party packages, if Yum finds replacements
            for them in the MySQL Yum repository; see
       <a class="xref" href="updating-yum-repo.html" title="3.8 Upgrading MySQL with the MySQL Yum Repository">
        Section 3.8, “Upgrading MySQL with the MySQL Yum Repository”
       </a>
       , for a discussion on
            some possible effects of that on your system, see
       <a class="xref" href="updating-yum-repo.html#updating-yum-repo-client-lib" title="Upgrading the Shared Client Libraries">
        Upgrading the Shared Client Libraries
       </a>
       .
      </p>
     </div>
    </li>
    <li class="listitem">
     <h4>
      <a name="yum-repo-select-series">
      </a>
      Selecting a Release Series
     </h4>
     <p>
      When using the MySQL Yum repository, the latest bugfix series
          (currently MySQL 8.4) is selected for
          installation by default. If this is what you want, you can
          skip to the next step,
      <a class="xref" href="linux-installation-yum-repo.html#yum-repo-installing-mysql" title="Installing MySQL">
       Installing MySQL
      </a>
      .
     </p>
     <p>
      Within the MySQL Yum repository, each MySQL Community Server
          release series is hosted in a different subrepository. The
          subrepository for the latest LTS series (currently MySQL
          8.4) is enabled by default, and the
          subrepositories for all other series' (for example, MySQL
          8.0 and the MySQL Innovation series) are
          disabled by default. Use this command to see all available
          MySQL-related subrepositories (for dnf-enabled systems,
          replace
      <span class="command">
       <strong>
        yum
       </strong>
      </span>
      in the command with
      <span class="command">
       <strong>
        dnf
       </strong>
      </span>
      ):
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa13723783"><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">yum</span> repolist all | grep mysql</code></pre>
     </div>
     <p>
      Example output:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa91605353"><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">mysql-connectors-community                 MySQL Connectors Community   enabled
mysql-tools-8<span class="token punctuation">.</span>4-lts-community               MySQL Tools 8<span class="token punctuation">.</span>4 LTS Community        enabled
mysql-tools-community                      MySQL Tools Community        disabled
mysql-tools-innovation-community           MySQL Tools Innovation Commu disabled
mysql-innovation-community                 MySQL Innovation Release Com disabled
mysql-8<span class="token punctuation">.</span>4-lts-community                          MySQL 8<span class="token punctuation">.</span>4 Community LTS Server   enabled
mysql-8<span class="token punctuation">.</span>4-lts-community-debuginfo                MySQL 8<span class="token punctuation">.</span>4 Community LTS Server - disabled
mysql-8<span class="token punctuation">.</span>4-lts-community-source                   MySQL 8<span class="token punctuation">.</span>4 Community LTS Server - disabled
mysql80-community                        MySQL 8<span class="token punctuation">.</span>0 Community Server - disabled
mysql80-community-debuginfo              MySQL 8<span class="token punctuation">.</span>0 Community Server - disabled
mysql80-community-source                 MySQL 8<span class="token punctuation">.</span>0 Community Server - disabled</code></pre>
     </div>
     <p>
      To install the latest release from a specific series other
          than the latest LTS series, disable the bug subrepository for
          the latest LTS series and enable the subrepository for the
          specific series before running the installation command. If
          your platform supports the
      <span class="command">
       <strong>
        yum-config-manager
       </strong>
      </span>
      or
      <span class="command">
       <strong>
        dnf
          config-manager
       </strong>
      </span>
      command, you can do that by issuing
          the following commands to disable the subrepository for the
          8.4 series and enable the one for the
          8.0 series:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa50096814"><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> yum-config-manager <span class="token property">--disable</span> mysql-8<span class="token punctuation">.</span>4-lts-community
<span class="token prompt">$&gt; </span><span class="token command">sudo</span> yum-config-manager <span class="token property">--enable</span>  mysql80-community</code></pre>
     </div>
     <p>
      For dnf-enabled platforms:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa92458064"><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> dnf config-manager <span class="token property">--disable</span> mysql-8<span class="token punctuation">.</span>4-lts-community
<span class="token prompt">$&gt; </span><span class="token command">sudo</span> dnf config-manager <span class="token property">--enable</span> mysql80-community</code></pre>
     </div>
     <p>
     </p>
     <p>
      Instead of using the config-manager commands you can manually
          edit the
      <code class="filename">
       /etc/yum.repos.d/mysql-community.repo
      </code>
      file by toggling the
      <code class="literal">
       enabled
      </code>
      option. For
          example, a typical default entry for EL8:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-ini"><div class="docs-select-all right" id="sa93112964"><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-ini"><span class="token selector">[mysql-8.4-lts-community]</span>
<span class="token constant">name</span><span class="token attr-value"><span class="token punctuation">=</span>MySQL 8.4 LTS Community Server</span>
<span class="token constant">baseurl</span><span class="token attr-value"><span class="token punctuation">=</span>http://repo.mysql.com/yum/mysql-8.4-community/el/8/$basearch/</span>
<span class="token constant">enabled</span><span class="token attr-value"><span class="token punctuation">=</span>1</span>
<span class="token constant">gpgcheck</span><span class="token attr-value"><span class="token punctuation">=</span>1</span>
<span class="token constant">gpgkey</span><span class="token attr-value"><span class="token punctuation">=</span>file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2023</span></code></pre>
     </div>
     <p>
      Find the entry for the subrepository you want to configure and
          edit the
      <code class="option">
       enabled
      </code>
      option. Specify
      <code class="option">
       enabled=0
      </code>
      to disable a subrepository or
      <code class="option">
       enabled=1
      </code>
      to enable a subrepository. For
          example, to install from the MySQL innovation track, make sure
          you have
      <code class="option">
       enabled=0
      </code>
      for the MySQL
          8.4 subrepository entries and have
      <code class="option">
       enabled=1
      </code>
      for the innovation entries:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-ini"><div class="docs-select-all right" id="sa84781896"><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-ini"><span class="token selector">[mysql80-community]</span>
<span class="token constant">name</span><span class="token attr-value"><span class="token punctuation">=</span>MySQL 8.0 Community Server</span>
<span class="token constant">baseurl</span><span class="token attr-value"><span class="token punctuation">=</span>http://repo.mysql.com/yum/mysql-8.0-community/el/8/$basearch</span>
<span class="token constant">enabled</span><span class="token attr-value"><span class="token punctuation">=</span>1</span>
<span class="token constant">gpgcheck</span><span class="token attr-value"><span class="token punctuation">=</span>1</span>
<span class="token constant">gpgkey</span><span class="token attr-value"><span class="token punctuation">=</span>file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2023</span></code></pre>
     </div>
     <p>
      You should only enable subrepository for one release series at
          any time.
     </p>
     <p>
      Verify that the correct subrepositories have been enabled and
          disabled by running the following command and checking its
          output (for dnf-enabled systems, replace
      <span class="command">
       <strong>
        yum
       </strong>
      </span>
      in the command with
      <span class="command">
       <strong>
        dnf
       </strong>
      </span>
      ):
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa96622488"><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">yum</span> repolist enabled | grep mysql</code></pre>
     </div>
    </li>
    <li class="listitem">
     <h4>
      <a name="yum-repo-disabling-mysql">
      </a>
      Disabling the Default MySQL Module
     </h4>
     <p>
      (EL8 systems only) EL8-based systems such as RHEL8 and Oracle
          Linux 8 include a MySQL module that is enabled by default.
          Unless this module is disabled, it masks packages provided by
          MySQL repositories. To disable the included module and make
          the MySQL repository packages visible, use the following
          command (for dnf-enabled systems, replace
      <span class="command">
       <strong>
        yum
       </strong>
      </span>
      in the command with
      <span class="command">
       <strong>
        dnf
       </strong>
      </span>
      ):
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa91691480"><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> yum module disable mysql</code></pre>
     </div>
    </li>
    <li class="listitem">
     <h4>
      <a name="yum-repo-installing-mysql">
      </a>
      Installing MySQL
     </h4>
     <p>
      Install MySQL by the following command (for dnf-enabled
          systems, replace
      <span class="command">
       <strong>
        yum
       </strong>
      </span>
      in the command with
      <span class="command">
       <strong>
        dnf
       </strong>
      </span>
      ):
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa80039500"><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> yum install mysql-community-server</code></pre>
     </div>
     <p>
      This installs the package for MySQL server
          (
      <code class="filename">
       mysql-community-server
      </code>
      ) and also
          packages for the components required to run the server,
          including packages for the client
          (
      <code class="filename">
       mysql-community-client
      </code>
      ), the common
          error messages and character sets for client and server
          (
      <code class="filename">
       mysql-community-common
      </code>
      ), and the shared
          client libraries (
      <code class="filename">
       mysql-community-libs
      </code>
      ).
     </p>
    </li>
    <li class="listitem">
     <h4>
      <a name="yum-repo-starting-and-stopping-server">
      </a>
      Starting the MySQL Server
     </h4>
     <p>
      Start 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="sa48219435"><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> start mysqld</code></pre>
     </div>
     <p>
      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="sa38740896"><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 mysqld</code></pre>
     </div>
    </li>
   </ol>
  </div>
  <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">
    mysqld
   </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>
  <p>
   At the initial start up of the server, the following happens,
      given that the data directory of the server is empty:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      The server is initialized.
     </p>
    </li>
    <li class="listitem">
     <p>
      SSL certificate and key files are generated in the data
          directory.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="validate-password.html" title="8.4.3 The Password Validation Component">
       <code class="literal">
        validate_password
       </code>
      </a>
      is installed and enabled.
     </p>
    </li>
    <li class="listitem">
     <p>
      A superuser account
      <code class="literal">
       'root'@'localhost
      </code>
      is
          created. A password for the superuser is set and stored in the
          error log file. To reveal it, use the following command:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa98002731"><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> grep <span class="token atrule">'temporary password'</span> /var/log/mysqld<span class="token punctuation">.</span>log</code></pre>
     </div>
     <p>
      Change the root password as soon as possible by logging in
          with the generated, temporary password and set a custom
          password for the superuser account:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa67606357"><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">mysql</span> <span class="token property">-uroot</span> <span class="token property">-p</span></code></pre>
     </div>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa60685561"><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-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">ALTER</span> <span class="token keyword">USER</span> <span class="token string">'root'</span>@<span class="token string">'localhost'</span> <span class="token keyword">IDENTIFIED</span> <span class="token keyword">BY</span> <span class="token string">'MyNewPass4!'</span><span class="token punctuation">;</span></code></pre>
     </div>
     <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
      <div class="admon-title">
       Note
      </div>
      <p>
       <a class="link" href="validate-password.html" title="8.4.3 The Password Validation Component">
        <code class="literal">
         validate_password
        </code>
       </a>
       is installed by default. The default password policy
            implemented by
       <code class="literal">
        validate_password
       </code>
       requires
            that passwords contain at least one uppercase letter, one
            lowercase letter, one digit, and one special character, and
            that the total password length is at least 8 characters.
      </p>
     </div>
    </li>
   </ul>
  </div>
  <p>
   For more information on the postinstallation procedures, see
   <a class="xref" href="postinstallation.html" title="2.9 Postinstallation Setup and Testing">
    Section 2.9, “Postinstallation Setup and Testing”
   </a>
   .
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    <a name="yum-install-compatibility-el7">
    </a>
    <span class="emphasis">
     <em>
      Compatibility Information for EL7-based
        platforms:
     </em>
    </span>
    The following RPM packages from the native
        software repositories of the platforms are incompatible with the
        package from the MySQL Yum repository that installs the MySQL
        server. Once you have installed MySQL using the MySQL Yum
        repository, you cannot install these packages (and vice versa).
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       akonadi-mysql
      </p>
     </li>
    </ul>
   </div>
  </div>
  <h4>
   <a name="yum-install-components">
   </a>
   Installing Additional MySQL Products and Components with Yum
  </h4>
  <p>
   You can use Yum to install and manage individual components of
      MySQL. Some of these components are hosted in sub-repositories of
      the MySQL Yum repository: for example, the MySQL Connectors are to
      be found in the MySQL Connectors Community sub-repository, and the
      MySQL Workbench in MySQL Tools Community. You can use the
      following command to list the packages for all the MySQL
      components available for your platform from the MySQL Yum
      repository (for dnf-enabled systems, replace
   <span class="command">
    <strong>
     yum
    </strong>
   </span>
   in the command with
   <span class="command">
    <strong>
     dnf
    </strong>
   </span>
   ):
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa66968771"><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> yum <span class="token constant">--disablerepo</span><span class="token attr-value"><span class="token punctuation">=</span>\*</span> <span class="token constant">--enablerepo</span>=<span class="token atrule">'mysql*-community*'</span> list available</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 (for dnf-enabled systems, replace
   <span class="command">
    <strong>
     yum
    </strong>
   </span>
   in the command with
   <span class="command">
    <strong>
     dnf
    </strong>
   </span>
   ):
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa50178393"><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> yum install <em class="replaceable">package-name</em></code></pre>
  </div>
  <p>
   For example, to install MySQL Workbench on Fedora:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa26949805"><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> dnf install mysql-workbench-community</code></pre>
  </div>
  <p>
   To install the shared client libraries (for dnf-enabled systems,
      replace
   <span class="command">
    <strong>
     yum
    </strong>
   </span>
   in the command with
   <span class="command">
    <strong>
     dnf
    </strong>
   </span>
   ):
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa99163932"><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> yum install mysql-community-libs</code></pre>
  </div>
  <h4>
   <a name="yum-install-platform-specifics">
   </a>
   Platform Specific Notes
  </h4>
  <p>
   ARM Support
  </p>
  <p>
   ARM 64-bit (aarch64) is supported on Oracle Linux 7 and requires
      the Oracle Linux 7 Software Collections Repository
      (ol7_software_collections). For example, to install the server:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa89496990"><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">yum-config-manager</span> <span class="token property">--enable</span> ol7_software_collections
<span class="token prompt">$&gt; </span><span class="token command">yum</span> install mysql-community-server</code></pre>
  </div>
  <h4>
   <a name="idm46045331283072">
   </a>
   Updating MySQL with Yum
  </h4>
  <p>
   Besides installation, you can also perform updates for MySQL
      products and components using the MySQL Yum repository. See
   <a class="xref" href="updating-yum-repo.html" title="3.8 Upgrading MySQL with the MySQL Yum Repository">
    Section 3.8, “Upgrading MySQL with the MySQL Yum Repository”
   </a>
   for details.
  </p>
  <h4>
   <a name="linux-installation-yum-repo-replace-third-party">
   </a>
   Replacing a Native Third-Party Distribution of MySQL
  </h4>
  <p>
   If you have installed a third-party distribution of MySQL from a
      native software repository (that is, a software repository
      provided by your own Linux distribution), follow these steps:
  </p>
  <div class="orderedlist">
   <ol class="orderedlist" type="1">
    <li class="listitem">
     <h4>
      <a name="idm46045331278304">
      </a>
      Backing Up Your Database
     </h4>
     <p>
      To avoid loss of data, always back up your database before
          trying to replace your MySQL installation using the MySQL Yum
          repository. See
      <a class="xref" href="backup-and-recovery.html" title="Chapter 9 Backup and Recovery">
       Chapter 9,
       <i>
        Backup and Recovery
       </i>
      </a>
      , on how
          to back up your database.
     </p>
    </li>
    <li class="listitem">
     <h4>
      <a name="idm46045331275712">
      </a>
      Adding the MySQL Yum Repository
     </h4>
     <p>
      Add the MySQL Yum repository to your system's repository list
          by following the instructions given in
      <a class="xref" href="linux-installation-yum-repo.html#yum-repo-setup" title="Adding the MySQL Yum Repository">
       Adding the MySQL Yum Repository
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <h4>
      <a name="idm46045331273312">
      </a>
      Replacing the Native Third-Party Distribution by a Yum Update or a DNF
Upgrade
     </h4>
     <p>
      By design, the MySQL Yum repository replaces your native,
          third-party MySQL with the latest bugfix release from the
          MySQL Yum repository when you perform a
      <span class="command">
       <strong>
        yum
          update
       </strong>
      </span>
      command (or
      <span class="command">
       <strong>
        dnf upgrade
       </strong>
      </span>
      for dnf-enabled systems) on the system, or a
      <span class="command">
       <strong>
        yum
          update mysql-server
       </strong>
      </span>
      (or
      <span class="command">
       <strong>
        dnf upgrade
          mysql-server
       </strong>
      </span>
      for dnf-enabled systems).
     </p>
    </li>
   </ol>
  </div>
  <p>
   After updating MySQL using the Yum repository, applications
      compiled with older versions of the shared client libraries should
      continue to work. However,
   <span class="emphasis">
    <em>
     if you want to recompile
      applications and dynamically link them with the updated
      libraries
    </em>
   </span>
   , see
   <a class="xref" href="updating-yum-repo.html#updating-yum-repo-client-lib" title="Upgrading the Shared Client Libraries">
    Upgrading the Shared Client Libraries
   </a>
   , for some special
      considerations.
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    <span class="emphasis">
     <em>
      For EL7-based platforms:
     </em>
    </span>
    See
    <a class="xref" href="linux-installation-yum-repo.html#yum-install-compatibility-el7">
     Compatibility Information for EL7-based platforms
    </a>
    .
   </p>
  </div>
 </div>
 <br/>
</div>
