<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="installing-development-tree">
      </a>
      2.8.5 Installing MySQL Using a Development Source Tree
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045329455920">
  </a>
  <a class="indexterm" name="idm46045329454848">
  </a>
  <p>
   This section describes how to install MySQL from the latest
      development source code, which is hosted on
   <a class="ulink" href="https://github.com/" target="_blank">
    GitHub
   </a>
   . To obtain the
      MySQL Server source code from this repository hosting service, you
      can set up a local MySQL Git repository.
  </p>
  <p>
   On
   <a class="ulink" href="https://github.com/" target="_blank">
    GitHub
   </a>
   , MySQL Server
      and other MySQL projects are found on the
   <a class="ulink" href="https://github.com/mysql" target="_blank">
    MySQL
   </a>
   page. The
      MySQL Server project is a single repository that contains branches
      for several MySQL series.
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="xref" href="installing-development-tree.html#installing-development-tree-prerequisites" title="Prerequisites for Installing from Development Source">
       Prerequisites for Installing from Development Source
      </a>
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="xref" href="installing-development-tree.html#installing-development-tree-git" title="Setting Up a MySQL Git Repository">
       Setting Up a MySQL Git Repository
      </a>
     </p>
    </li>
   </ul>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="installing-development-tree-prerequisites">
       </a>
       Prerequisites for Installing from Development Source
      </h4>
     </div>
    </div>
   </div>
   <p>
    To install MySQL from a development source tree, your system
        must satisfy 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>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h4 class="title">
       <a name="installing-development-tree-git">
       </a>
       Setting Up a MySQL Git Repository
      </h4>
     </div>
    </div>
   </div>
   <p>
    To set up a MySQL Git repository on your machine:
   </p>
   <div class="orderedlist">
    <ol class="orderedlist" type="1">
     <li class="listitem">
      <p>
       Clone the MySQL Git repository to your machine. The
            following command clones the MySQL Git repository to a
            directory named
       <code class="filename">
        mysql-server
       </code>
       . The
            initial download may take some time to complete, depending
            on the speed of your connection.
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa61267802"><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">git</span> clone https<span class="token punctuation">:</span>//github<span class="token punctuation">.</span>com/mysql/mysql-server<span class="token punctuation">.</span>git
Cloning into <span class="token atrule">'mysql-server'</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
remote<span class="token punctuation">:</span> Counting objects<span class="token punctuation">:</span> 1198513<span class="token punctuation">,</span> done<span class="token punctuation">.</span>
remote<span class="token punctuation">:</span> Total 1198513 <span class="token punctuation">(</span>delta 0<span class="token punctuation">)</span><span class="token punctuation">,</span> reused 0 <span class="token punctuation">(</span>delta 0<span class="token punctuation">)</span><span class="token punctuation">,</span> pack-reused 1198513
Receiving objects<span class="token punctuation">:</span> 100% <span class="token punctuation">(</span>1198513/1198513<span class="token punctuation">)</span><span class="token punctuation">,</span> 1<span class="token punctuation">.</span>01 GiB | 7<span class="token punctuation">.</span>44 MiB/s<span class="token punctuation">,</span> done<span class="token punctuation">.</span>
Resolving deltas<span class="token punctuation">:</span> 100% <span class="token punctuation">(</span>993200/993200<span class="token punctuation">)</span><span class="token punctuation">,</span> done<span class="token punctuation">.</span>
Checking connectivity<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span> done<span class="token punctuation">.</span>
Checking out files<span class="token punctuation">:</span> 100% <span class="token punctuation">(</span>25510/25510<span class="token punctuation">)</span><span class="token punctuation">,</span> done<span class="token punctuation">.</span></code></pre>
      </div>
     </li>
     <li class="listitem">
      <p>
       When the clone operation completes, the contents of your
            local MySQL Git repository appear similar to the following:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa14645549"><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">~&gt; cd mysql-server
~/mysql-server&gt; ls
client             extra                mysys              storage
cmake              include              packaging          strings
CMakeLists<span class="token punctuation">.</span>txt     INSTALL              plugin             support-files
components         libbinlogevents      README             testclients
config<span class="token punctuation">.</span>h<span class="token punctuation">.</span>cmake     libchangestreams     router             unittest
configure<span class="token punctuation">.</span>cmake    libmysql             run_doxygen<span class="token punctuation">.</span>cmake  utilities
Docs               libservices          scripts            VERSION
Doxyfile-ignored   LICENSE              share              vio
Doxyfile<span class="token punctuation">.</span>in        man                  sql                win
doxygen_resources  mysql-test           sql-common</code></pre>
      </div>
     </li>
     <li class="listitem">
      <p>
       Use the
       <span class="command">
        <strong>
         git branch -r
        </strong>
       </span>
       command to view the
            remote tracking branches for the MySQL repository.
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa89084690"><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-server&gt; git branch <span class="token property">-r</span>
  origin/5<span class="token punctuation">.</span>7
  origin/8<span class="token punctuation">.</span>0
  origin/HEAD <span class="token property">-&gt;</span> origin/trunk
  origin/cluster-7<span class="token punctuation">.</span>4
  origin/cluster-7<span class="token punctuation">.</span>5
  origin/cluster-7<span class="token punctuation">.</span>6
  origin/trunk</code></pre>
      </div>
     </li>
     <li class="listitem">
      <p>
       To view the branch that is checked out in your local
            repository, issue the
       <span class="command">
        <strong>
         git branch
        </strong>
       </span>
       command.
            When you clone the MySQL Git repository, the latest MySQL
            branch is checked out automatically. The asterisk identifies
            the active branch.
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa59857564"><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">~/mysql-server$ </span><span class="token command">git</span> branch
* trunk</code></pre>
      </div>
     </li>
     <li class="listitem">
      <p>
       To check out an earlier MySQL branch, run the
       <span class="command">
        <strong>
         git
            checkout
        </strong>
       </span>
       command, specifying the branch name. For
            example, to check out the MySQL 8.0 branch:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa44755329"><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">~/mysql-server$ </span><span class="token command">git</span> checkout 8<span class="token punctuation">.</span>0
Checking out files<span class="token punctuation">:</span> 100% <span class="token punctuation">(</span>9600/9600<span class="token punctuation">)</span><span class="token punctuation">,</span> done<span class="token punctuation">.</span>
Branch 8<span class="token punctuation">.</span>0 set up to track remote branch 8<span class="token punctuation">.</span>0 from origin<span class="token punctuation">.</span>
Switched to a new branch <span class="token atrule">'8.0'</span></code></pre>
      </div>
     </li>
     <li class="listitem">
      <p>
       To obtain changes made after your initial setup of the MySQL
            Git repository, switch to the branch you want to update and
            issue the
       <span class="command">
        <strong>
         git pull
        </strong>
       </span>
       command:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa96108164"><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">~/mysql-server$ </span><span class="token command">git</span> checkout trunk
<span class="token prompt">~/mysql-server$ </span><span class="token command">git</span> pull</code></pre>
      </div>
      <p>
       To examine the commit history, use the
       <span class="command">
        <strong>
         git
            log
        </strong>
       </span>
       command:
      </p>
      <div class="copytoclipboard-wrapper">
       <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa97041530"><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">~/mysql-server$ </span><span class="token command">git</span> log</code></pre>
      </div>
      <p>
       You can also browse commit history and source code on the
            GitHub
       <a class="ulink" href="https://github.com/mysql" target="_blank">
        MySQL
       </a>
       site.
      </p>
      <p>
       If you see changes or code that you have a question about,
            ask on
       <a class="ulink" href="https://mysqlcommunity.slack.com/" target="_blank">
        MySQL
            Community Slack
       </a>
       .
      </p>
     </li>
     <li class="listitem">
      <p>
       After you have cloned the MySQL Git repository and have
            checked out the branch you want to build, you can build
            MySQL Server from the source code. Instructions are provided
            in
       <a class="xref" href="installing-source-distribution.html" title="2.8.4 Installing MySQL Using a Standard Source Distribution">
        Section 2.8.4, “Installing MySQL Using a Standard Source Distribution”
       </a>
       , except
            that you skip the part about obtaining and unpacking the
            distribution.
      </p>
      <p>
       Be careful about installing a build from a distribution
            source tree on a production machine. The installation
            command may overwrite your live release installation. If you
            already have MySQL installed and do not want to overwrite
            it, run
       <span class="command">
        <strong>
         CMake
        </strong>
       </span>
       with values for the
       <a class="link" href="source-configuration-options.html#option_cmake_cmake_install_prefix">
        <code class="option">
         CMAKE_INSTALL_PREFIX
        </code>
       </a>
       ,
       <a class="link" href="source-configuration-options.html#option_cmake_mysql_tcp_port">
        <code class="option">
         MYSQL_TCP_PORT
        </code>
       </a>
       , and
       <a class="link" href="source-configuration-options.html#option_cmake_mysql_unix_addr">
        <code class="option">
         MYSQL_UNIX_ADDR
        </code>
       </a>
       options
            different from those used by your production server. For
            additional information about preventing multiple servers
            from interfering with each other, see
       <a class="xref" href="multiple-servers.html" title="7.8 Running Multiple MySQL Instances on One Machine">
        Section 7.8, “Running Multiple MySQL Instances on One Machine”
       </a>
       .
      </p>
      <p>
       Play hard with your new installation. For example, try to
            make new features crash. Start by running
       <span class="command">
        <strong>
         make
            test
        </strong>
       </span>
       . See
       <a class="ulink" href="/doc/extending-mysql/8.4/en/mysql-test-suite.html" target="_top">
        The MySQL Test Suite
       </a>
       .
      </p>
     </li>
    </ol>
   </div>
  </div>
 </div>
 <br/>
</div>
