Documentation Home
MySQL Installation Guide
Related Documentation Download this Excerpt
PDF (US Ltr) - 2.4Mb
PDF (A4) - 2.4Mb


MySQL Installation Guide  / Installing MySQL from Source  /  Installing MySQL Using a Development Source Tree

4.5 Installing MySQL Using a Development Source Tree

This section describes how to install MySQL from the latest development source code, which is hosted onGitHub. To obtain the MySQL Server source code from this repository hosting service, you can set up a local MySQL Git repository.

OnGitHub, MySQL Server and other MySQL projects are found on theMySQL page. The MySQL Server project is a single repository that contains branches for several MySQL series.

Prerequisites for Installing from Development Source

To install MySQL from a development source tree, your system must satisfy the tool requirements listed atSection 4.2, “Source Installation Prerequisites”.

Setting Up a MySQL Git Repository

To set up a MySQL Git repository on your machine:

  1. Clone the MySQL Git repository to your machine. The following command clones the MySQL Git repository to a directory namedmysql-server. The initial download may take some time to complete, depending on the speed of your connection.

    $> git clone https://github.com/mysql/mysql-server.gitCloning into 'mysql-server'...remote: Counting objects: 1198513, done.remote: Total 1198513 (delta 0), reused 0 (delta 0), pack-reused 1198513Receiving objects: 100% (1198513/1198513), 1.01 GiB | 7.44 MiB/s, done.Resolving deltas: 100% (993200/993200), done.Checking connectivity... done.Checking out files: 100% (25510/25510), done.
  2. When the clone operation completes, the contents of your local MySQL Git repository appear similar to the following:

    ~> cd mysql-server~/mysql-server> lsclient             extra                mysys              storagecmake              include              packaging          stringsCMakeLists.txt     INSTALL              plugin             support-filescomponents         libbinlogevents      README             testclientsconfig.h.cmake     libchangestreams     router             unittestconfigure.cmake    libmysql             run_doxygen.cmake  utilitiesDocs               libservices          scripts            VERSIONDoxyfile-ignored   LICENSE              share              vioDoxyfile.in        man                  sql                windoxygen_resources  mysql-test           sql-common
  3. Use thegit branch -r command to view the remote tracking branches for the MySQL repository.

    ~/mysql-server> git branch -r  origin/5.7  origin/8.0  origin/HEAD -> origin/trunk  origin/cluster-7.4  origin/cluster-7.5  origin/cluster-7.6  origin/trunk
  4. To view the branch that is checked out in your local repository, issue thegit branch command. When you clone the MySQL Git repository, the latest MySQL branch is checked out automatically. The asterisk identifies the active branch.

    ~/mysql-server$ git branch* trunk
  5. To check out an earlier MySQL branch, run thegit checkout command, specifying the branch name. For example, to check out the MySQL 5.7 branch:

    ~/mysql-server$ git checkout 5.7Checking out files: 100% (9600/9600), done.Branch 5.7 set up to track remote branch 5.7 from origin.Switched to a new branch '5.7'
  6. To obtain changes made after your initial setup of the MySQL Git repository, switch to the branch you want to update and issue thegit pull command:

    ~/mysql-server$ git checkout 8.0~/mysql-server$ git pull

    To examine the commit history, use thegit log command:

    ~/mysql-server$ git log

    You can also browse commit history and source code on the GitHubMySQL site.

    If you see changes or code that you have a question about, ask onMySQL Community Slack.

  7. 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 inSection 4.4, “Installing MySQL Using a Standard Source Distribution”, except that you skip the part about obtaining and unpacking the distribution.

    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, runCMake with values for theCMAKE_INSTALL_PREFIX,MYSQL_TCP_PORT, andMYSQL_UNIX_ADDR options different from those used by your production server. For additional information about preventing multiple servers from interfering with each other, seeRunning Multiple MySQL Instances on One Machine.

    Play hard with your new installation. For example, try to make new features crash. Start by runningmake test. SeeThe MySQL Test Suite.