Checking out the Source with Git

The MariaDB source is now hosted on Github:

At any given time, developers will be working on their own branches locally or on Github, with the main MariaDB branches receiving pushes less often.

The main MariaDB branches are:

Source repositories for the MariaDB Connectors are:

See the Using git page for instructions on how to use git to check out the source code and switch between the various branches.

The rest of this page contains information on checking out the MariaDB source from Launchpad. As the current source is now on Github, the information is mainly of historical interest and not useful for current development.

The instructions on this page will help you download your own local branch of the MariaDB source code repository with the full revision history. If you want a tarball of the source without the revision history, see the MariaDB download page.

Checking out the Source with Bazaar

If you simply want to browse the source code, you can do so from


You need Bazaar for revision control.


  1. Prepare a directory to keep your MariaDB code in:
    mkdir $repo # where $repo is some directory (ex: ~/repos)
    cd $repo
    bzr init-repo maria # this creates ~/repos/maria
  2. Get a clean local copy of the Maria repo with:
    cd $repo/maria # (ex: ~/repos/maria)
    bzr branch lp:maria trunk
    The above will give you the latest stable MariaDB version. If you want to get another release use lp:maria/5.2, lp:maria/5.3... For a complete list, go to Launchpad and choose 'Code' from the top menu on the page.
    • Note: The initial branch operation can take a long time depending on the speed of your Internet connection and the load on launchpad. For this initial branch you need to download over a gigabyte of data.
    • Note: Bzr is written in Python and very slow for initial checkout. Even on a fast connection, expect to need 1-2 GByte of RAM and possibly several CPU hours for the checkout.
  3. If you get an error like:
    bzr: ERROR: Unknown repository format: 'Bazaar RepositoryFormatKnitPack6 (bzr 1.9)'
    then the version of bzr you are using is too old. Using version 1.12 or higher will fix this error.
  4. If you have upgraded your bzr and are unable to successfully branch from launchpad, try using the source tree tarball (below) instead.
  5. You can see the current history with:
    cd $repo/maria/trunk
    bzr log | less
  6. If you are going to be hacking on the MariaDB source code. See the Contributing Code page for help.
  7. If you just want to compile MariaDB at this point, see the Compiling MariaDB page.

Source Tree Tarball

For those that have trouble branching MariaDB from Launchpad we have created a tarball of a complete repository of the MariaDB tree.


You need Bazaar to work with the repository.

Using the Source Tree Tarball

  1. Download the mariadb-shared-repo.tgz file from one of the MariaDB mirrors.
    • The file is 267MB, so the download may take a long time to complete depending on your Internet connection.
  2. The .tgz file contains a .bzr directory. The parent directory of this .bzr directory is (or becomes) a shared repository containing the MariaDB source code. It is recommended to create a new directory for this, so the next step is to create a directory to house the repository. Call this directory anything you like ("maria", "mariadb", "my", "src", etc...). Once created, cd into the directory and untar the file. Here is an example using the name "mariadb" for the new directory, with the directory located in a directory called "src" in the home directory of the current user, and the mariadb-shared-repo.tgz file located in a directory named Downloads (also in the current user's home directory):
    cd ${sourcecodedir}
    mkdir ${mariadbdir}
    cd ${mariadbdir}
    tar -zxvf ${downloadsdir}/mariadb-shared-repo.tgz
  3. After the untar step you will have a bzr shared repository, but not a working tree. While in the shared repository directory, use the bzr branch command to branch the MariaDB trees you are interested in. For example:
    • bzr branch lp:maria/5.2
    • bzr branch lp:maria
  4. Thanks to the repository, either of the above commands will complete very fast.
  5. Before working with the code, make sure you pull down the latest version of the source code:
    cd mariadb-5.2 #or to wherever your MariaDB tree is
    bzr pull
  6. You can now use this source tree as if you had branched it from launchpad directly.

Alternate Bazaar Instructions

The following alternative instructions are what we have used for setting up repositories on our build machines in buildbot.

Shell Variables

To streamline later steps, we start by setting several shell variables. Set the values of the BZR and WORK_DIR variables to the appropriate values for your Linux distribution. The rest of the variables in this section should not need to be changed.







Source Checkout

Initialize your bzr working directories, if not done already:

$BZR init-repo $MARIA_DIR

Check out MariaDB sources:


Check out packaging sources (only for MariaDB 5.3 and below):



Comments loading...