<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="installing-source-distribution">
      </a>
      2.8.4 Installing MySQL Using a Standard Source Distribution
     </h3>
    </div>
   </div>
  </div>
  <p>
   To install MySQL from a standard source distribution:
  </p>
  <div class="orderedlist">
   <ol class="orderedlist" type="1">
    <li class="listitem">
     <p>
      Verify that your system satisfies the tool requirements listed
          at
      <a class="xref" href="source-installation-prerequisites.html" title="2.8.2 Source Installation Prerequisites">
       Section 2.8.2, “Source Installation Prerequisites”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      Obtain a distribution file using the instructions in
      <a class="xref" href="getting-mysql.html" title="2.1.3 How to Get MySQL">
       Section 2.1.3, “How to Get MySQL”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      Configure, build, and install the distribution using the
          instructions in this section.
     </p>
    </li>
    <li class="listitem">
     <p>
      Perform postinstallation procedures using the instructions in
      <a class="xref" href="postinstallation.html" title="2.9 Postinstallation Setup and Testing">
       Section 2.9, “Postinstallation Setup and Testing”
      </a>
      .
     </p>
    </li>
   </ol>
  </div>
  <p>
   MySQL uses
   <span class="command">
    <strong>
     CMake
    </strong>
   </span>
   as the build framework on all
      platforms. The instructions given here should enable you to
      produce a working installation. For additional information on
      using
   <span class="command">
    <strong>
     CMake
    </strong>
   </span>
   to build MySQL, see
   <a class="ulink" href="/doc/internals/en/cmake.html" target="_top">
    How to Build MySQL
      Server with CMake
   </a>
   .
  </p>
  <p>
   If you start from a source RPM, use the following command to make
      a binary RPM that you can install. If you do not have
   <span class="command">
    <strong>
     rpmbuild
    </strong>
   </span>
   , use
   <span class="command">
    <strong>
     rpm
    </strong>
   </span>
   instead.
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa21440044"><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">rpmbuild</span> <span class="token property">--rebuild</span> <span class="token property">--clean</span> MySQL-<em class="replaceable">VERSION</em><span class="token punctuation">.</span>src<span class="token punctuation">.</span>rpm</code></pre>
  </div>
  <p>
   The result is one or more binary RPM packages that you install as
      indicated in
   <a class="xref" href="linux-installation-rpm.html" title="2.5.4 Installing MySQL on Linux Using RPM Packages from Oracle">
    Section 2.5.4, “Installing MySQL on Linux Using RPM Packages from Oracle”
   </a>
   .
  </p>
  <p>
   The sequence for installation from a compressed
   <span class="command">
    <strong>
     tar
    </strong>
   </span>
   file or Zip archive source distribution is
      similar to the process for installing from a generic binary
      distribution (see
   <a class="xref" href="binary-installation.html" title="2.2 Installing MySQL on Unix/Linux Using Generic Binaries">
    Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”
   </a>
   ), except
      that it is used on all platforms and includes steps to configure
      and compile the distribution. For example, with a compressed
   <span class="command">
    <strong>
     tar
    </strong>
   </span>
   file source distribution on Unix, the basic
      installation command sequence looks like this:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa16949329"><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 comment" spellcheck="true"># Preconfiguration setup</span>
<span class="token prompt">$&gt; </span><span class="token command">groupadd</span> mysql
<span class="token prompt">$&gt; </span><span class="token command">useradd</span> <span class="token property">-r</span> <span class="token property">-g</span> mysql <span class="token property">-s</span> /bin/false mysql
<span class="token comment" spellcheck="true"># Beginning of source-build specific instructions</span>
<span class="token prompt">$&gt; </span><span class="token command">tar</span> zxvf mysql-<em class="replaceable">VERSION</em><span class="token punctuation">.</span>tar<span class="token punctuation">.</span>gz
<span class="token prompt">$&gt; </span><span class="token command">cd</span> mysql-<em class="replaceable">VERSION</em>
<span class="token prompt">$&gt; </span><span class="token command">mkdir</span> bld
<span class="token prompt">$&gt; </span><span class="token command">cd</span> bld
<span class="token prompt">$&gt; </span><span class="token command">cmake</span> <span class="token punctuation">.</span><span class="token punctuation">.</span>
<span class="token prompt">$&gt; </span><span class="token command">make</span>
<span class="token prompt">$&gt; </span><span class="token command">make</span> install
<span class="token comment" spellcheck="true"># End of source-build specific instructions</span>
<span class="token comment" spellcheck="true"># Postinstallation setup</span>
<span class="token prompt">$&gt; </span><span class="token command">cd</span> /usr/local/mysql
<span class="token prompt">$&gt; </span><span class="token command">mkdir</span> mysql-files
<span class="token prompt">$&gt; </span><span class="token command">chown</span> mysql<span class="token punctuation">:</span>mysql mysql-files
<span class="token prompt">$&gt; </span><span class="token command">chmod</span> 750 mysql-files
<span class="token prompt">$&gt; </span><span class="token command">bin/mysqld</span> <span class="token property">--initialize</span> <span class="token constant">--user</span><span class="token attr-value"><span class="token punctuation">=</span>mysql</span>
<span class="token prompt">$&gt; </span><span class="token command">bin/mysqld_safe</span> <span class="token constant">--user</span><span class="token attr-value"><span class="token punctuation">=</span>mysql</span> &amp;
<span class="token comment" spellcheck="true"># Next command is optional</span>
<span class="token prompt">$&gt; </span><span class="token command">cp</span> support-files/mysql<span class="token punctuation">.</span>server /etc/init<span class="token punctuation">.</span>d/mysql<span class="token punctuation">.</span>server</code></pre>
  </div>
  <p>
   A more detailed version of the source-build specific instructions
      is shown following.
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    The procedure shown here does not set up any passwords for MySQL
        accounts. After following the procedure, proceed to
    <a class="xref" href="postinstallation.html" title="2.9 Postinstallation Setup and Testing">
     Section 2.9, “Postinstallation Setup and Testing”
    </a>
    , for postinstallation setup
        and testing.
   </p>
  </div>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="xref" href="installing-source-distribution.html#installing-source-distribution-preconfiguration" title="Perform Preconfiguration Setup">
       Perform Preconfiguration Setup
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="installing-source-distribution.html#installing-source-distribution-obtain-distribution" title="Obtain and Unpack the Distribution">
       Obtain and Unpack the Distribution
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="installing-source-distribution.html#installing-source-distribution-configure-distribution" title="Configure the Distribution">
       Configure the Distribution
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="installing-source-distribution.html#installing-source-distribution-build-distribution" title="Build the Distribution">
       Build the Distribution
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="installing-source-distribution.html#installing-source-distribution-install-distribution" title="Install the Distribution">
       Install the Distribution
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="installing-source-distribution.html#installing-source-distribution-postinstallation" title="Perform Postinstallation Setup">
       Perform Postinstallation Setup
      </a>
     </p>
    </li>
   </ul>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="installing-source-distribution-preconfiguration">
       </a>
       Perform Preconfiguration Setup
      </h4>
     </div>
    </div>
   </div>
   <p>
    On Unix, set up the
    <code class="literal">
     mysql
    </code>
    user that owns the
        database directory and that should be used to run and execute
        the MySQL server, and the group to which this user belongs. For
        details, see
    <a class="xref" href="binary-installation.html#binary-installation-createsysuser" title="Create a mysql User and Group">
     Create a mysql User and Group
    </a>
    . Then
        perform the following steps as the
    <code class="literal">
     mysql
    </code>
    user, except as noted.
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="installing-source-distribution-obtain-distribution">
       </a>
       Obtain and Unpack the Distribution
      </h4>
     </div>
    </div>
   </div>
   <p>
    Pick the directory under which you want to unpack the
        distribution and change location into it.
   </p>
   <p>
    Obtain a distribution file using the instructions in
    <a class="xref" href="getting-mysql.html" title="2.1.3 How to Get MySQL">
     Section 2.1.3, “How to Get MySQL”
    </a>
    .
   </p>
   <p>
    Unpack the distribution into the current directory:
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       To unpack a compressed
       <span class="command">
        <strong>
         tar
        </strong>
       </span>
       file,
       <span class="command">
        <strong>
         tar
        </strong>
       </span>
       can decompress and unpack the
            distribution if it has
       <code class="literal">
        z
       </code>
       option support:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa74745520"><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> zxvf mysql-<em class="replaceable">VERSION</em><span class="token punctuation">.</span>tar<span class="token punctuation">.</span>gz</code></pre>
      </div>
      <p>
       If your
       <span class="command">
        <strong>
         tar
        </strong>
       </span>
       does not have
       <code class="literal">
        z
       </code>
       option support, use
       <span class="command">
        <strong>
         gunzip
        </strong>
       </span>
       to decompress the distribution and
       <span class="command">
        <strong>
         tar
        </strong>
       </span>
       to unpack it:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa87137834"><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">gunzip</span> &lt; mysql-<em class="replaceable">VERSION</em><span class="token punctuation">.</span>tar<span class="token punctuation">.</span>gz | tar xvf -</code></pre>
      </div>
      <p>
       Alternatively,
       <span class="command">
        <strong>
         CMake
        </strong>
       </span>
       can decompress and
            unpack the distribution:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa84623119"><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">cmake</span> <span class="token property">-E</span> tar zxvf mysql-<em class="replaceable">VERSION</em><span class="token punctuation">.</span>tar<span class="token punctuation">.</span>gz</code></pre>
      </div>
     </li>
     <li class="listitem">
      <p>
       To unpack a Zip archive, use
       <span class="command">
        <strong>
         WinZip
        </strong>
       </span>
       or
            another tool that can read
       <code class="filename">
        .zip
       </code>
       files.
      </p>
     </li>
    </ul>
   </div>
   <p>
    Unpacking the distribution file creates a directory named
    <code class="filename">
     mysql-
     <em class="replaceable">
      <code>
       VERSION
      </code>
     </em>
    </code>
    .
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="installing-source-distribution-configure-distribution">
       </a>
       Configure the Distribution
      </h4>
     </div>
    </div>
   </div>
   <p>
    Change location into the top-level directory of the unpacked
        distribution:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa91816187"><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">cd</span> mysql-<em class="replaceable">VERSION</em></code></pre>
   </div>
   <p>
    Build outside of the source tree to keep the tree clean. If the
        top-level source directory is named
    <code class="filename">
     mysql-src
    </code>
    under your current working
        directory, you can build in a directory named
    <code class="filename">
     build
    </code>
    at the same level. Create the
        directory and go there:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa95178304"><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">mkdir</span> bld
<span class="token prompt">$&gt; </span><span class="token command">cd</span> bld</code></pre>
   </div>
   <p>
    Configure the build directory. The minimum configuration command
        includes no options to override configuration defaults:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa65649578"><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">cmake</span> <span class="token punctuation">.</span><span class="token punctuation">.</span>/mysql-src</code></pre>
   </div>
   <p>
    The build directory need not be outside the source tree. For
        example, you can build in a directory named
    <code class="filename">
     build
    </code>
    under the top-level source tree. To
        do this, starting with
    <code class="filename">
     mysql-src
    </code>
    as your
        current working directory, create the directory
    <code class="filename">
     build
    </code>
    and then go there:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa25167705"><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">mkdir</span> build
<span class="token prompt">$&gt; </span><span class="token command">cd</span> build</code></pre>
   </div>
   <p>
    Configure the build directory. The minimum configuration command
        includes no options to override configuration defaults:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa93530715"><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">cmake</span> <span class="token punctuation">.</span><span class="token punctuation">.</span></code></pre>
   </div>
   <p>
    If you have multiple source trees at the same level (for
        example, to build multiple versions of MySQL), the second
        strategy can be advantageous. The first strategy places all
        build directories at the same level, which requires that you
        choose a unique name for each. With the second strategy, you can
        use the same name for the build directory within each source
        tree. The following instructions assume this second strategy.
   </p>
   <p>
    On Windows, specify the development environment. For example,
        the following commands configure MySQL for 32-bit or 64-bit
        builds, respectively:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa43751918"><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">cmake</span> <span class="token punctuation">.</span><span class="token punctuation">.</span> <span class="token property">-G</span> <span class="token atrule">"Visual Studio 12 2013"</span>

<span class="token prompt">$&gt; </span><span class="token command">cmake</span> <span class="token punctuation">.</span><span class="token punctuation">.</span> <span class="token property">-G</span> <span class="token atrule">"Visual Studio 12 2013 Win64"</span></code></pre>
   </div>
   <p>
    On macOS, to use the Xcode IDE:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa73658087"><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">cmake</span> <span class="token punctuation">.</span><span class="token punctuation">.</span> <span class="token property">-G</span> Xcode</code></pre>
   </div>
   <p>
    When you run
    <span class="command">
     <strong>
      Cmake
     </strong>
    </span>
    , you might want to add
        options to the command line. Here are some examples:
   </p>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       <a class="link" href="source-configuration-options.html#option_cmake_build_config">
        <code class="option">
         -DBUILD_CONFIG=mysql_release
        </code>
       </a>
       :
            Configure the source with the same build options used by
            Oracle to produce binary distributions for official MySQL
            releases.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="link" href="source-configuration-options.html#option_cmake_cmake_install_prefix">
        <code class="option">
         -DCMAKE_INSTALL_PREFIX=
         <em class="replaceable">
          <code>
           dir_name
          </code>
         </em>
        </code>
       </a>
       :
            Configure the distribution for installation under a
            particular location.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="link" href="source-configuration-options.html#option_cmake_cpack_monolithic_install">
        <code class="option">
         -DCPACK_MONOLITHIC_INSTALL=1
        </code>
       </a>
       :
            Cause
       <span class="command">
        <strong>
         make package
        </strong>
       </span>
       to generate a single
            installation file rather than multiple files.
      </p>
     </li>
     <li class="listitem">
      <p>
       <a class="link" href="source-configuration-options.html#option_cmake_with_debug">
        <code class="option">
         -DWITH_DEBUG=1
        </code>
       </a>
       : Build the
            distribution with debugging support.
      </p>
     </li>
    </ul>
   </div>
   <p>
    For a more extensive list of options, see
    <a class="xref" href="source-configuration-options.html" title="2.8.7 MySQL Source-Configuration Options">
     Section 2.8.7, “MySQL Source-Configuration Options”
    </a>
    .
   </p>
   <p>
    To list the configuration options, use one of the following
        commands:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa96771446"><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">cmake</span> <span class="token punctuation">.</span><span class="token punctuation">.</span> <span class="token property">-L</span>   <span class="token comment" spellcheck="true"># overview</span>

<span class="token prompt">$&gt; </span><span class="token command">cmake</span> <span class="token punctuation">.</span><span class="token punctuation">.</span> <span class="token property">-LH</span>  <span class="token comment" spellcheck="true"># overview with help text</span>

<span class="token prompt">$&gt; </span><span class="token command">cmake</span> <span class="token punctuation">.</span><span class="token punctuation">.</span> <span class="token property">-LAH</span> <span class="token comment" spellcheck="true"># all params with help text</span>

<span class="token prompt">$&gt; </span><span class="token command">ccmake</span> <span class="token punctuation">.</span><span class="token punctuation">.</span>     <span class="token comment" spellcheck="true"># interactive display</span></code></pre>
   </div>
   <p>
    If
    <span class="command">
     <strong>
      CMake
     </strong>
    </span>
    fails, you might need to reconfigure
        by running it again with different options. If you do
        reconfigure, take note of the following:
   </p>
   <a class="indexterm" name="idm46045329513008">
   </a>
   <a class="indexterm" name="idm46045329511920">
   </a>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       If
       <span class="command">
        <strong>
         CMake
        </strong>
       </span>
       is run after it has previously
            been run, it may use information that was gathered during
            its previous invocation. This information is stored in
       <code class="filename">
        CMakeCache.txt
       </code>
       . When
       <span class="command">
        <strong>
         CMake
        </strong>
       </span>
       starts, it looks for that file and
            reads its contents if it exists, on the assumption that the
            information is still correct. That assumption is invalid
            when you reconfigure.
      </p>
     </li>
     <li class="listitem">
      <p>
       Each time you run
       <span class="command">
        <strong>
         CMake
        </strong>
       </span>
       , you must run
       <span class="command">
        <strong>
         make
        </strong>
       </span>
       again to recompile. However, you may
            want to remove old object files from previous builds first
            because they were compiled using different configuration
            options.
      </p>
     </li>
    </ul>
   </div>
   <p>
    To prevent old object files or configuration information from
        being used, run these commands in the build directory on Unix
        before re-running
    <span class="command">
     <strong>
      CMake
     </strong>
    </span>
    :
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa23171168"><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">make</span> clean
<span class="token prompt">$&gt; </span><span class="token command">rm</span> CMakeCache<span class="token punctuation">.</span>txt</code></pre>
   </div>
   <p>
    Or, on Windows:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa37989542"><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">devenv</span> MySQL<span class="token punctuation">.</span>sln /clean
<span class="token prompt">$&gt; </span><span class="token command">del</span> CMakeCache<span class="token punctuation">.</span>txt</code></pre>
   </div>
   <p>
    Before asking on the
    <a class="ulink" href="https://mysqlcommunity.slack.com/" target="_blank">
     MySQL Community
        Slack
    </a>
    , check the files in the
    <code class="filename">
     CMakeFiles
    </code>
    directory for useful information
        about the failure. To file a bug report, please use the
        instructions in
    <a class="xref" href="bug-reports.html" title="1.6 How to Report Bugs or Problems">
     Section 1.6, “How to Report Bugs or Problems”
    </a>
    .
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="installing-source-distribution-build-distribution">
       </a>
       Build the Distribution
      </h4>
     </div>
    </div>
   </div>
   <p>
    On Unix:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa23112457"><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">make</span>
<span class="token prompt">$&gt; </span><span class="token command">make</span> VERBOSE<span class="token attr-value"><span class="token punctuation">=</span>1</span></code></pre>
   </div>
   <p>
    The second command sets
    <code class="literal">
     VERBOSE
    </code>
    to show the
        commands for each compiled source.
   </p>
   <p>
    Use
    <span class="command">
     <strong>
      gmake
     </strong>
    </span>
    instead on systems where you are
        using GNU
    <span class="command">
     <strong>
      make
     </strong>
    </span>
    and it has been installed as
    <span class="command">
     <strong>
      gmake
     </strong>
    </span>
    .
   </p>
   <p>
    On Windows:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa8588986"><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">devenv</span> MySQL<span class="token punctuation">.</span>sln /build RelWithDebInfo</code></pre>
   </div>
   <p>
    If you have gotten to the compilation stage, but the
        distribution does not build, see
    <a class="xref" href="compilation-problems.html" title="2.8.8 Dealing with Problems Compiling MySQL">
     Section 2.8.8, “Dealing with Problems Compiling MySQL”
    </a>
    , for help. If that does
        not solve the problem, please enter it into our bugs database
        using the instructions given in
    <a class="xref" href="bug-reports.html" title="1.6 How to Report Bugs or Problems">
     Section 1.6, “How to Report Bugs or Problems”
    </a>
    .
        If you have installed the latest versions of the required tools,
        and they crash trying to process our configuration files, please
        report that also. However, if you get a
    <code class="literal">
     command not
        found
    </code>
    error or a similar problem for required tools,
        do not report it. Instead, make sure that all the required tools
        are installed and that your
    <code class="literal">
     PATH
    </code>
    variable is
        set correctly so that your shell can find them.
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="installing-source-distribution-install-distribution">
       </a>
       Install the Distribution
      </h4>
     </div>
    </div>
   </div>
   <p>
    On Unix:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa93996107"><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">make</span> install</code></pre>
   </div>
   <p>
    This installs the files under the configured installation
        directory (by default,
    <code class="filename">
     /usr/local/mysql
    </code>
    ).
        You might need to run the command as
    <code class="literal">
     root
    </code>
    .
   </p>
   <p>
    To install in a specific directory, add a
    <code class="literal">
     DESTDIR
    </code>
    parameter to the command line:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa87419501"><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">make</span> install DESTDIR=<span class="token atrule">"/opt/mysql"</span></code></pre>
   </div>
   <p>
    Alternatively, generate installation package files that you can
        install where you like:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa15818716"><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">make</span> package</code></pre>
   </div>
   <p>
    This operation produces one or more
    <code class="filename">
     .tar.gz
    </code>
    files that can be installed like generic binary distribution
        packages. See
    <a class="xref" href="binary-installation.html" title="2.2 Installing MySQL on Unix/Linux Using Generic Binaries">
     Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”
    </a>
    . If you run
    <span class="command">
     <strong>
      CMake
     </strong>
    </span>
    with
    <a class="link" href="source-configuration-options.html#option_cmake_cpack_monolithic_install">
     <code class="option">
      -DCPACK_MONOLITHIC_INSTALL=1
     </code>
    </a>
    , the
        operation produces a single file. Otherwise, it produces
        multiple files.
   </p>
   <p>
    On Windows, generate the data directory, then create a
    <code class="filename">
     .zip
    </code>
    archive installation package:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa85263756"><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">devenv</span> MySQL<span class="token punctuation">.</span>sln /build RelWithDebInfo /project initial_database
<span class="token prompt">$&gt; </span><span class="token command">devenv</span> MySQL<span class="token punctuation">.</span>sln /build RelWithDebInfo /project package</code></pre>
   </div>
   <p>
    You can install the resulting
    <code class="filename">
     .zip
    </code>
    archive
        where you like. See
    <a class="xref" href="windows-install-archive.html" title="2.3.3 Configuration: Manually">
     Section 2.3.3, “Configuration: Manually”
    </a>
    .
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="installing-source-distribution-postinstallation">
       </a>
       Perform Postinstallation Setup
      </h4>
     </div>
    </div>
   </div>
   <p>
    The remainder of the installation process involves setting up
        the configuration file, creating the core databases, and
        starting the MySQL server. For instructions, 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>
     The accounts that are listed in the MySQL grant tables
          initially have no passwords. After starting the server, you
          should set up passwords for them using the instructions in
     <a class="xref" href="postinstallation.html" title="2.9 Postinstallation Setup and Testing">
      Section 2.9, “Postinstallation Setup and Testing”
     </a>
     .
    </p>
   </div>
  </div>
 </div>
 <br/>
</div>
