<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="linux-installation-rpm">
      </a>
      2.5.4 Installing MySQL on Linux Using RPM Packages from Oracle
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045330806832">
  </a>
  <a class="indexterm" name="idm46045330805792">
  </a>
  <a class="indexterm" name="idm46045330804720">
  </a>
  <p>
   The recommended way to install MySQL on RPM-based Linux
      distributions is by using the RPM packages provided by Oracle.
      There are two sources for obtaining them, for the Community
      Edition of MySQL:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      From the MySQL software repositories:
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         The MySQL Yum repository (see
         <a class="xref" href="linux-installation-yum-repo.html" title="2.5.1 Installing MySQL on Linux Using the MySQL Yum Repository">
          Section 2.5.1, “Installing MySQL on Linux Using the MySQL Yum Repository”
         </a>
         for
              details).
        </p>
       </li>
       <li class="listitem">
        <p>
         The MySQL SLES repository (see
         <a class="xref" href="linux-installation-sles-repo.html" title="2.5.3 Using the MySQL SLES Repository">
          Section 2.5.3, “Using the MySQL SLES Repository”
         </a>
         for
              details).
        </p>
       </li>
      </ul>
     </div>
    </li>
    <li class="listitem">
     <p>
      From the
      <a class="ulink" href="https://dev.mysql.com/downloads/mysql/" target="_top">
       Download
          MySQL Community Server
      </a>
      page in the
      <a class="ulink" href="https://dev.mysql.com/" target="_top">
       MySQL Developer Zone
      </a>
      .
     </p>
    </li>
   </ul>
  </div>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    RPM distributions of MySQL are also provided by other vendors.
        Be aware that they may differ from those built by Oracle in
        features, capabilities, and conventions (including communication
        setup), and that the installation instructions in this manual do
        not necessarily apply to them. The vendor's instructions should
        be consulted instead.
   </p>
  </div>
  <h4>
   <a name="idm46045330793488">
   </a>
   MySQL RPM Packages
  </h4>
  <div class="table">
   <a name="idm46045330792800">
   </a>
   <p class="title">
    <b>
     Table 2.8 RPM Packages for MySQL Community Edition
    </b>
   </p>
   <div class="table-contents">
    <table frame="all">
     <colgroup>
      <col style="width: 35%"/>
      <col style="width: 25%"/>
     </colgroup>
     <thead>
      <tr>
       <th>
        Package Name
       </th>
       <th>
        Summary
       </th>
      </tr>
     </thead>
     <tbody>
      <tr>
       <td>
        <code class="literal">
         mysql-community-client
        </code>
       </td>
       <td>
        MySQL client applications and tools
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         mysql-community-client-plugins
        </code>
       </td>
       <td>
        Shared plugins for MySQL client applications
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         mysql-community-common
        </code>
       </td>
       <td>
        Common files for server and client libraries
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         mysql-community-devel
        </code>
       </td>
       <td>
        Development header files and libraries for MySQL database client
            applications
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         mysql-community-embedded-compat
        </code>
       </td>
       <td>
        MySQL server as an embedded library with compatibility for applications
            using version 18 of the library
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         mysql-community-icu-data-files
        </code>
       </td>
       <td>
        MySQL packaging of ICU data files needed by MySQL regular expressions
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         mysql-community-libs
        </code>
       </td>
       <td>
        Shared libraries for MySQL database client applications
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         mysql-community-libs-compat
        </code>
       </td>
       <td>
        Shared compatibility libraries for previous MySQL installations; only
            present if previous MySQL versions are supported by the
            platform
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         mysql-community-server
        </code>
       </td>
       <td>
        Database server and related tools
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         mysql-community-server-debug
        </code>
       </td>
       <td>
        Debug server and plugin binaries
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         mysql-community-test
        </code>
       </td>
       <td>
        Test suite for the MySQL server
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         mysql-community
        </code>
       </td>
       <td>
        The source code RPM looks similar to
            mysql-community-8.4.3-1.el7.src.rpm, depending
            on selected OS
       </td>
      </tr>
      <tr>
       <td>
        Additional *debuginfo* RPMs
       </td>
       <td>
        There are several
        <code class="literal">
         debuginfo
        </code>
        packages:
            mysql-community-client-debuginfo,
            mysql-community-libs-debuginfo
            mysql-community-server-debug-debuginfo
            mysql-community-server-debuginfo, and
            mysql-community-test-debuginfo.
       </td>
      </tr>
     </tbody>
    </table>
   </div>
   <div class="table-contents">
    <table cellpadding="0" cellspacing="0" style="position: fixed; top: 0px; display: none; left: 401px; width: 739px;">
     <thead>
      <tr>
       <th style="width: 430.484px;">
        Package Name
       </th>
       <th style="width: 307.516px;">
        Summary
       </th>
      </tr>
     </thead>
    </table>
   </div>
  </div>
  <br class="table-break"/>
  <div class="table">
   <a name="idm46045330752480">
   </a>
   <p class="title">
    <b>
     Table 2.9 RPM Packages for the MySQL Enterprise Edition
    </b>
   </p>
   <div class="table-contents">
    <table frame="all">
     <colgroup>
      <col style="width: 35%"/>
      <col style="width: 25%"/>
     </colgroup>
     <thead>
      <tr>
       <th>
        Package Name
       </th>
       <th>
        Summary
       </th>
      </tr>
     </thead>
     <tbody>
      <tr>
       <td>
        <code class="literal">
         mysql-commercial-backup
        </code>
       </td>
       <td>
        MySQL Enterprise Backup
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         mysql-commercial-client
        </code>
       </td>
       <td>
        MySQL client applications and tools
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         mysql-commercial-client-plugins
        </code>
       </td>
       <td>
        Shared plugins for MySQL client applications
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         mysql-commercial-common
        </code>
       </td>
       <td>
        Common files for server and client libraries
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         mysql-commercial-devel
        </code>
       </td>
       <td>
        Development header files and libraries for MySQL database client
            applications
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         mysql-commercial-embedded-compat
        </code>
       </td>
       <td>
        MySQL server as an embedded library with compatibility for applications
            using version 18 of the library
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         mysql-commercial-icu-data-files
        </code>
       </td>
       <td>
        MySQL packaging of ICU data files needed by MySQL regular expressions
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         mysql-commercial-libs
        </code>
       </td>
       <td>
        Shared libraries for MySQL database client applications
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         mysql-commercial-libs-compat
        </code>
       </td>
       <td>
        Shared compatibility libraries for previous MySQL installations; only
            present if previous MySQL versions are supported by the
            platform. The version of the libraries matches the version
            of the libraries installed by default by the distribution
            you are using.
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         mysql-commercial-server
        </code>
       </td>
       <td>
        Database server and related tools
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         mysql-commercial-test
        </code>
       </td>
       <td>
        Test suite for the MySQL server
       </td>
      </tr>
      <tr>
       <td>
        Additional *debuginfo* RPMs
       </td>
       <td>
        There are several
        <code class="literal">
         debuginfo
        </code>
        packages:
            mysql-commercial-client-debuginfo,
            mysql-commercial-libs-debuginfo
            mysql-commercial-server-debug-debuginfo
            mysql-commercial-server-debuginfo, and
            mysql-commercial-test-debuginfo.
       </td>
      </tr>
     </tbody>
    </table>
   </div>
   <div class="table-contents">
    <table cellpadding="0" cellspacing="0" style="position: fixed; top: 0px; display: none; left: 401px; width: 739px;">
     <thead>
      <tr>
       <th style="width: 430.484px;">
        Package Name
       </th>
       <th style="width: 307.516px;">
        Summary
       </th>
      </tr>
     </thead>
    </table>
   </div>
  </div>
  <br class="table-break"/>
  <p>
   The full names for the RPMs have the following syntax:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa8362808"><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"><em class="replaceable">packagename</em>-<em class="replaceable">version</em>-<em class="replaceable">distribution</em>-<em class="replaceable">arch</em><span class="token punctuation">.</span>rpm</code></pre>
  </div>
  <p>
   The
   <em class="replaceable">
    <code>
     distribution
    </code>
   </em>
   and
   <em class="replaceable">
    <code>
     arch
    </code>
   </em>
   values indicate the Linux
      distribution and the processor type for which the package was
      built. See the table below for lists of the distribution
      identifiers:
  </p>
  <div class="table">
   <a name="idm46045330710288">
   </a>
   <p class="title">
    <b>
     Table 2.10 MySQL Linux RPM Package Distribution Identifiers
    </b>
   </p>
   <div class="table-contents">
    <table>
     <colgroup>
      <col style="width: 25%"/>
      <col style="width: 75%"/>
     </colgroup>
     <thead>
      <tr>
       <th>
        Distribution Value
       </th>
       <th>
        Intended Use
       </th>
      </tr>
     </thead>
     <tbody>
      <tr>
       <td>
        el
        <em class="replaceable">
         <code>
          {version}
         </code>
        </em>
        where
        <em class="replaceable">
         <code>
          {version}
         </code>
        </em>
        is the major Enterprise
            Linux version, such as
        <code class="literal">
         el8
        </code>
       </td>
       <td>
        EL6 (8.0), EL7, EL8, and EL9-based platforms (for example, the corresponding versions of Oracle Linux, Red Hat Enterprise Linux, and CentOS)
       </td>
      </tr>
      <tr>
       <td>
        fc
        <em class="replaceable">
         <code>
          {version}
         </code>
        </em>
        where
        <em class="replaceable">
         <code>
          {version}
         </code>
        </em>
        is the major Fedora
            version, such as
        <code class="literal">
         fc37
        </code>
       </td>
       <td>
        Fedora 39, 40, and 41
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         sl5
        </code>
       </td>
       <td>
        SUSE Linux Enterprise Server 15
       </td>
      </tr>
     </tbody>
    </table>
   </div>
  </div>
  <br class="table-break"/>
  <p>
   To see all files in an RPM package (for example,
   <code class="literal">
    mysql-community-server
   </code>
   ), use the following
      command:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa16131180"><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">rpm</span> <span class="token property">-qpl</span> mysql-community-server-<em class="replaceable">version</em>-<em class="replaceable">distribution</em>-<em class="replaceable">arch</em><span class="token punctuation">.</span>rpm</code></pre>
  </div>
  <p>
   <span class="emphasis">
    <em>
     The discussion in the rest of this section applies only
      to an installation process using the RPM packages directly
      downloaded from Oracle, instead of through a MySQL
      repository.
    </em>
   </span>
  </p>
  <p>
   Dependency relationships exist among some of the packages. If you
      plan to install many of the packages, you may wish to download the
      RPM bundle
   <span class="command">
    <strong>
     tar
    </strong>
   </span>
   file instead, which contains all
      the RPM packages listed above, so that you need not download them
      separately.
  </p>
  <p>
   In most cases, you need to install the
   <code class="literal">
    mysql-community-server
   </code>
   ,
   <code class="literal">
    mysql-community-client
   </code>
   ,
   <code class="literal">
    mysql-community-client-plugins
   </code>
   ,
   <code class="literal">
    mysql-community-libs
   </code>
   ,
   <code class="literal">
    mysql-community-icu-data-files
   </code>
   ,
   <code class="literal">
    mysql-community-common
   </code>
   , and
   <code class="literal">
    mysql-community-libs-compat
   </code>
   packages to get a
      functional, standard MySQL installation. To perform such a
      standard, basic installation, go to the folder that contains all
      those packages (and, preferably, no other RPM packages with
      similar names), and issue the following command:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa95537303"><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-<span class="token punctuation">{</span>server<span class="token punctuation">,</span>client<span class="token punctuation">,</span>client-plugins<span class="token punctuation">,</span>icu-data-files<span class="token punctuation">,</span>common<span class="token punctuation">,</span>libs<span class="token punctuation">}</span>-*</code></pre>
  </div>
  <p>
   Replace
   <span class="command">
    <strong>
     yum
    </strong>
   </span>
   with
   <span class="command">
    <strong>
     zypper
    </strong>
   </span>
   for
      SLES, and with
   <span class="command">
    <strong>
     dnf
    </strong>
   </span>
   for Fedora.
  </p>
  <p>
   While it is much preferable to use a high-level package management
      tool like
   <span class="command">
    <strong>
     yum
    </strong>
   </span>
   to install the packages, users
      who prefer direct
   <span class="command">
    <strong>
     rpm
    </strong>
   </span>
   commands can replace the
   <span class="command">
    <strong>
     yum install
    </strong>
   </span>
   command with the
   <span class="command">
    <strong>
     rpm
      -Uvh
    </strong>
   </span>
   command; however, using
   <span class="command">
    <strong>
     rpm -Uvh
    </strong>
   </span>
   instead makes the installation process more prone to failure, due
      to potential dependency issues the installation process might run
      into.
  </p>
  <p>
   To install only the client programs, you can skip
   <code class="literal">
    mysql-community-server
   </code>
   in your list of packages
      to install; issue the following command:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa52073376"><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-<span class="token punctuation">{</span>client<span class="token punctuation">,</span>client-plugins<span class="token punctuation">,</span>common<span class="token punctuation">,</span>libs<span class="token punctuation">}</span>-*</code></pre>
  </div>
  <p>
   Replace
   <span class="command">
    <strong>
     yum
    </strong>
   </span>
   with
   <span class="command">
    <strong>
     zypper
    </strong>
   </span>
   for
      SLES, and with
   <span class="command">
    <strong>
     dnf
    </strong>
   </span>
   for Fedora.
  </p>
  <p>
   A standard installation of MySQL using the RPM packages result in
      files and resources created under the system directories, shown in
      the following table.
  </p>
  <div class="table">
   <a name="mysql-installation-layout-linuxrpm">
   </a>
   <p class="title">
    <b>
     Table 2.11 MySQL Installation Layout for Linux RPM Packages from the MySQL Developer Zone
    </b>
   </p>
   <div class="table-contents">
    <table>
     <colgroup>
      <col style="width: 55%"/>
      <col style="width: 45%"/>
     </colgroup>
     <thead>
      <tr>
       <th>
        Files or Resources
       </th>
       <th>
        Location
       </th>
      </tr>
     </thead>
     <tbody>
      <tr>
       <td>
        Client programs and scripts
       </td>
       <td>
        <code class="filename">
         /usr/bin
        </code>
       </td>
      </tr>
      <tr>
       <td>
        <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
         <span class="command">
          <strong>
           mysqld
          </strong>
         </span>
        </a>
        server
       </td>
       <td>
        <code class="filename">
         /usr/sbin
        </code>
       </td>
      </tr>
      <tr>
       <td>
        Configuration file
       </td>
       <td>
        <code class="filename">
         /etc/my.cnf
        </code>
       </td>
      </tr>
      <tr>
       <td>
        Data directory
       </td>
       <td>
        <code class="filename">
         /var/lib/mysql
        </code>
       </td>
      </tr>
      <tr>
       <td>
        Error log file
       </td>
       <td>
        <p>
         For RHEL, Oracle Linux, CentOS or Fedora platforms:
         <code class="filename">
          /var/log/mysqld.log
         </code>
        </p>
        <p>
         For SLES:
         <code class="filename">
          /var/log/mysql/mysqld.log
         </code>
        </p>
       </td>
      </tr>
      <tr>
       <td>
        Value of
        <a class="link" href="server-system-variables.html#sysvar_secure_file_priv">
         <code class="literal">
          secure_file_priv
         </code>
        </a>
       </td>
       <td>
        <code class="filename">
         /var/lib/mysql-files
        </code>
       </td>
      </tr>
      <tr>
       <td>
        System V init script
       </td>
       <td>
        <p>
         For RHEL, Oracle Linux, CentOS or Fedora platforms:
         <code class="filename">
          /etc/init.d/mysqld
         </code>
        </p>
        <p>
         For SLES:
         <code class="filename">
          /etc/init.d/mysql
         </code>
        </p>
       </td>
      </tr>
      <tr>
       <td>
        Systemd service
       </td>
       <td>
        <p>
         For RHEL, Oracle Linux, CentOS or Fedora platforms:
         <code class="filename">
          mysqld
         </code>
        </p>
        <p>
         For SLES:
         <code class="filename">
          mysql
         </code>
        </p>
       </td>
      </tr>
      <tr>
       <td>
        Pid file
       </td>
       <td>
        <code class="filename">
         /var/run/mysql/mysqld.pid
        </code>
       </td>
      </tr>
      <tr>
       <td>
        Socket
       </td>
       <td>
        <code class="filename">
         /var/lib/mysql/mysql.sock
        </code>
       </td>
      </tr>
      <tr>
       <td>
        Keyring directory
       </td>
       <td>
        <code class="filename">
         /var/lib/mysql-keyring
        </code>
       </td>
      </tr>
      <tr>
       <td>
        Unix manual pages
       </td>
       <td>
        <code class="filename">
         /usr/share/man
        </code>
       </td>
      </tr>
      <tr>
       <td>
        Include (header) files
       </td>
       <td>
        <code class="filename">
         /usr/include/mysql
        </code>
       </td>
      </tr>
      <tr>
       <td>
        Libraries
       </td>
       <td>
        <code class="filename">
         /usr/lib/mysql
        </code>
       </td>
      </tr>
      <tr>
       <td>
        Miscellaneous support files (for example, error messages, and character
            set files)
       </td>
       <td>
        <code class="filename">
         /usr/share/mysql
        </code>
       </td>
      </tr>
     </tbody>
    </table>
   </div>
   <div class="table-contents">
    <table cellpadding="0" cellspacing="0" style="position: fixed; top: 0px; display: none; left: 401px; width: 739px;">
     <thead>
      <tr>
       <th style="width: 405.891px;">
        Files or Resources
       </th>
       <th style="width: 332.109px;">
        Location
       </th>
      </tr>
     </thead>
    </table>
   </div>
  </div>
  <br class="table-break"/>
  <p>
   The installation also creates a user named
   <code class="literal">
    mysql
   </code>
   and a group named
   <code class="literal">
    mysql
   </code>
   on the system.
  </p>
  <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
       <code class="literal">
        mysql
       </code>
       user is created using the
       <code class="option">
        -r
       </code>
       and
       <code class="option">
        -s /bin/false
       </code>
       options of the
       <span class="command">
        <strong>
         useradd
        </strong>
       </span>
       command, so that it does not have login permissions to your
            server host (see
       <a class="ulink" href="/doc/mysql-secure-deployment-guide/en/secure-deployment-install.html#secure-deployment-mysql-user" target="_top">
        Creating
            the mysql User and Group
       </a>
       for details). To switch to
            the
       <code class="literal">
        mysql
       </code>
       user on your OS, use the
       <code class="option">
        --shell=/bin/bash
       </code>
       option for the
       <span class="command">
        <strong>
         su
        </strong>
       </span>
       command:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-simple"><div class="docs-select-all right" id="sa50170708"><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">$<span class="token operator">&gt;</span> su <span class="token operator">-</span> mysql <span class="token operator">--</span>shell<span class="token operator">=</span><span class="token operator">/</span>bin<span class="token operator">/</span>bash</code></pre>
      </div>
      <p>
      </p>
     </li>
     <li class="listitem">
      <p>
       Installation of previous versions of MySQL using older
            packages might have created a configuration file named
       <code class="filename">
        /usr/my.cnf
       </code>
       . It is highly recommended
            that you examine the contents of the file and migrate the
            desired settings inside to the file
       <code class="filename">
        /etc/my.cnf
       </code>
       file, then remove
       <code class="filename">
        /usr/my.cnf
       </code>
       .
      </p>
     </li>
    </ul>
   </div>
  </div>
  <p>
   MySQL is NOT automatically started at the end of the installation
      process. For Red Hat Enterprise Linux, Oracle Linux, CentOS, and
      Fedora systems, use the following command to start MySQL:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa93778825"><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>
   For SLES systems, the command is the same, but the service name is
      different:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa22519783"><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 mysql</code></pre>
  </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. Notice that certain things might work
      differently on systemd platforms: for example, changing the
      location of the data directory might cause issues. 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>
   During an upgrade installation using RPM and DEB packages, if the
      MySQL server is running when the upgrade occurs then the MySQL
      server is stopped, the upgrade occurs, and the MySQL server is
      restarted. One exception: if the edition also changes during an
      upgrade (such as community to commercial, or vice-versa), then
      MySQL server is not restarted.
  </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>
      An 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 for
          RHEL, Oracle Linux, CentOS, and Fedora systems:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa90733018"><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>
      Use the following command for SLES systems:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa53326635"><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/mysql/mysqld<span class="token punctuation">.</span>log</code></pre>
     </div>
     <p>
      The next step is to log in with the generated, temporary
          password and set a custom password for the superuser account:
     </p>
    </li>
   </ul>
  </div>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa61630237"><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="sa21459832"><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>
  <p>
   If something goes wrong during installation, you might find debug
      information in the error log file
   <code class="filename">
    /var/log/mysqld.log
   </code>
   .
  </p>
  <p>
   For some Linux distributions, it might be necessary to increase
      the limit on number of file descriptors available to
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   . See
   <a class="xref" href="not-enough-file-handles.html" title="B.3.2.16 File Not Found and Similar Errors">
    Section B.3.2.16, “File Not Found and Similar Errors”
   </a>
  </p>
  <p>
   <b>
    Installing Client Libraries from Multiple MySQL Versions.
   </b>
   It is possible to install multiple client library versions, such
        as for the case that you want to maintain compatibility with
        older applications linked against previous libraries. To install
        an older client library, use the
   <code class="option">
    --oldpackage
   </code>
   option with
   <span class="command">
    <strong>
     rpm
    </strong>
   </span>
   . For example, to install
   <code class="literal">
    mysql-community-libs-5.5
   </code>
   on an EL6 system
        that has
   <code class="literal">
    libmysqlclient.21
   </code>
   from MySQL 8.0,
        use a command like this:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa76794320"><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">rpm</span> <span class="token property">--oldpackage</span> <span class="token property">-ivh</span> mysql-community-libs-5<span class="token punctuation">.</span>5<span class="token punctuation">.</span>50-2<span class="token punctuation">.</span>el6<span class="token punctuation">.</span>x86_64<span class="token punctuation">.</span>rpm</code></pre>
  </div>
  <p>
   <b>
    Debug Package.
   </b>
   A special variant of MySQL Server compiled with the
   <a class="link" href="dbug-package.html" title="7.9.4 The DBUG Package">
    debug package
   </a>
   has been
        included in the server RPM packages. It performs debugging and
        memory allocation checks and produces a trace file when the
        server is running. To use that debug version, start MySQL with
   <code class="filename">
    /usr/sbin/mysqld-debug
   </code>
   , instead of starting
        it as a service or with
   <code class="filename">
    /usr/sbin/mysqld
   </code>
   .
        See
   <a class="xref" href="dbug-package.html" title="7.9.4 The DBUG Package">
    Section 7.9.4, “The DBUG Package”
   </a>
   for the debug options you can
        use.
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    The default plugin directory is
    <code class="filename">
     /usr/lib64/mysql/plugin/debug
    </code>
    and is
        configurable with
    <a class="link" href="server-system-variables.html#sysvar_plugin_dir">
     <code class="literal">
      plugin_dir
     </code>
    </a>
    .
   </p>
  </div>
  <p>
   <b>
    Rebuilding RPMs from source SRPMs.
   </b>
   Source code SRPM packages for MySQL are available for download.
        They can be used as-is to rebuild the MySQL RPMs with the
        standard
   <span class="command">
    <strong>
     rpmbuild
    </strong>
   </span>
   tool chain.
  </p>
 </div>
 <br/>
</div>
