<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="linux-installation-debian">
      </a>
      2.5.5 Installing MySQL on Linux Using Debian Packages from Oracle
     </h3>
    </div>
   </div>
  </div>
  <p>
   Oracle provides Debian packages for installing MySQL on Debian or
      Debian-like Linux systems. The packages are available through two
      different channels:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      The
      <a class="ulink" href="https://dev.mysql.com/downloads/repo/apt/" target="_top">
       MySQL APT
          Repository
      </a>
      . This is the preferred method for
          installing MySQL on Debian-like systems, as it provides a
          simple and convenient way to install and update MySQL
          products. For details, see
      <a class="xref" href="linux-installation-apt-repo.html" title="2.5.2 Installing MySQL on Linux Using the MySQL APT Repository">
       Section 2.5.2, “Installing MySQL on Linux Using the MySQL APT Repository”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      The
      <a class="ulink" href="https://dev.mysql.com/downloads/" target="_top">
       MySQL Developer Zone's
          Download Area
      </a>
      . For details, see
      <a class="xref" href="getting-mysql.html" title="2.1.3 How to Get MySQL">
       Section 2.1.3, “How to Get MySQL”
      </a>
      . The following are some
          information on the Debian packages available there and the
          instructions for installing them:
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         Various Debian packages are provided in the MySQL
              Developer Zone for installing different components of
              MySQL on the current Debian and Ubuntu platforms. The
              preferred method is to use the tarball bundle, which
              contains the packages needed for a basic setup of MySQL.
              The tarball bundles have names in the format of
         <code class="filename">
          mysql-server_
          <em class="replaceable">
           <code>
            MVER
           </code>
          </em>
          -
          <em class="replaceable">
           <code>
            DVER
           </code>
          </em>
          _
          <em class="replaceable">
           <code>
            CPU
           </code>
          </em>
          .deb-bundle.tar
         </code>
         .
         <em class="replaceable">
          <code>
           MVER
          </code>
         </em>
         is the MySQL version and
         <em class="replaceable">
          <code>
           DVER
          </code>
         </em>
         is the Linux distribution
              version. The
         <em class="replaceable">
          <code>
           CPU
          </code>
         </em>
         value
              indicates the processor type or family for which the
              package is built, as shown in the following table:
        </p>
        <div class="table">
         <a name="idm46045330542448">
         </a>
         <p class="title">
          <b>
           Table 2.12 MySQL Debian and Ubuntu Installation Packages CPU Identifiers
          </b>
         </p>
         <div class="table-contents">
          <table>
           <colgroup>
            <col style="width: 25%"/>
            <col style="width: 75%"/>
           </colgroup>
           <thead>
            <tr>
             <th>
              <em class="replaceable">
               <code>
                CPU
               </code>
              </em>
              Value
             </th>
             <th>
              Intended Processor Type or Family
             </th>
            </tr>
           </thead>
           <tbody>
            <tr>
             <td>
              <code class="literal">
               i386
              </code>
             </td>
             <td>
              Pentium processor or better, 32 bit
             </td>
            </tr>
            <tr>
             <td>
              <code class="literal">
               amd64
              </code>
             </td>
             <td>
              64-bit x86 processor
             </td>
            </tr>
           </tbody>
          </table>
         </div>
        </div>
        <br class="table-break"/>
       </li>
       <li class="listitem">
        <p>
         After downloading the tarball, unpack it with the
              following command:
        </p>
        <div class="copytoclipboard-wrapper">
         <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa71203982"><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">tar</span> <span class="token property">-xvf</span> mysql-server_<em class="replaceable">MVER</em>-<em class="replaceable">DVER</em>_<em class="replaceable">CPU</em><span class="token punctuation">.</span>deb-bundle<span class="token punctuation">.</span>tar</code></pre>
        </div>
       </li>
       <li class="listitem">
        <p>
         <a class="indexterm" name="idm46045330527248">
         </a>
         You may need to install the
         <code class="literal">
          libaio
         </code>
         library if it is not already present on your system:
        </p>
        <div class="copytoclipboard-wrapper">
         <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa23213529"><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 libaio1</code></pre>
        </div>
       </li>
       <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="sa163383"><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_*<span class="token punctuation">.</span>deb</code></pre>
        </div>
        <p>
         You are asked to provide a password for the root user for
              your MySQL installation. You might also be asked other
              questions regarding the installation.
        </p>
        <div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
         <div class="admon-title">
          Important
         </div>
         <p>
          <a name="linux-installing-debian-password">
          </a>
          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="guibutton">
           OK
          </span>
          ;
                in that case, root access to the server is authenticated
                using the
          <a class="link" href="socket-pluggable-authentication.html" title="8.4.1.10 Socket Peer-Credential Pluggable Authentication">
           MySQL
                Socket Peer-Credential Authentication Plugin
          </a>
          for
                connections using a Unix socket file. You can set the
                root password later using
          <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>
       </li>
       <li class="listitem">
        <p>
         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); you can do that with a single
              command:
        </p>
        <div class="copytoclipboard-wrapper">
         <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa21008731"><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-plugins<span class="token punctuation">,</span>community-client-core<span class="token punctuation">,</span>community-client<span class="token punctuation">,</span>client<span class="token punctuation">,</span>community-server-core<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>
        <p>
         There are also packages with
         <code class="literal">
          server-core
         </code>
         and
         <code class="literal">
          client-core
         </code>
         in the package names. These
              contain binaries only and are installed automatically by
              the standard packages. Installing them by themselves does
              not result in a functioning MySQL setup.
        </p>
        <p>
         If you are being warned of unmet dependencies by
         <span class="command">
          <strong>
           dpkg
          </strong>
         </span>
         (such as libmecab2), 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="sa49730019"><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>
        <p>
         Here are where the files are installed on the system:
        </p>
        <div class="itemizedlist">
         <ul class="itemizedlist" style="list-style-type: square; ">
          <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>
       </li>
      </ul>
     </div>
    </li>
   </ul>
  </div>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    Debian 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 instructions in this manual
        do not necessarily apply to installing them. The vendor's
        instructions should be consulted instead.
   </p>
  </div>
 </div>
 <br/>
</div>
