Install MariaDB on Windows from Source Code

arun3sh

Arunesh Choudhary

Posted on April 26, 2023

Install MariaDB on Windows from Source Code

Let's build MariaDB on Windows


There are few pre-requisite we need to install before even start building the server:

1. Visual C++

Download and Install Visual C++ from Microsoft. Community Version 2019 and 2022 are supported at this time.

Make sure to select and install "Desktop Development with C++" during the installation process.

Visual Code Installation

2. CMake

Download CMake from cmake-v3.26.0 and install on the machine.

  • Minimum version required: 3.14

Check out one of my blog on CMake installation

Make sure to add C:\GnuWin32\bin to your windows system path.

Have a look at my blog how to add program to SYSTEM PATH

3. Git

Download and Install git using Git-2.39.2-64-bit.exe

While installing git, make sure to select the PATH environment as follows:
Git Installation

Bison

GNU diff is a command-line tool for comparing the contents of two files or directories and highlighting the differences between them. It is part of the GNU Utilities software suite and is widely available on Unix-based operating systems, including Linux and macOS.

The main purpose of GNU diff is to help users identify differences between two text files or directories. It does this by analyzing the contents of each file or directory and highlighting the lines or sections that differ. Users can specify various options to customize the output of GNU diff, such as ignoring whitespace differences or suppressing certain types of changes.

GNU diff is a powerful and flexible tool that is commonly used in software development, system administration, and other technical fields. It can help users detect changes in code, configuration files, and other important data, and can be integrated into automated workflows to streamline various tasks.

Install BISON on your system

Build

  • Get the source code

You will be able to find the source code of MariaDB from their GitHub repo MariaDB Github Repository

  • Clone the repo to your system
git clone git@github.com:MariaDB/server.git 
Enter fullscreen mode Exit fullscreen mode

After the clone is complete, you will have a complete copy of the repository in the server directory. You can then work on the code locally, commit changes, and push them back to the remote repository as needed.

  • Create Build directory
# create a directory with name "build-dir"
mkdir build-dir

# go into "build-dir"
cd build-dir

# Run the following commands in sequence

cmake ../server

# If you want to build with Debugging option
# otherwise just omit  --config Debug
cmake --build . --config Debug
Enter fullscreen mode Exit fullscreen mode

Build will take a while to complete and make sure there are no errors while building.

# go to the directory
cd ..\build-dir\mysql-test

# Test your build
perl mysql-test-run.pl --suite=main --parallel=auto

Enter fullscreen mode Exit fullscreen mode

If all the tests came out as passed, we have installed the MariaDB perfectly on Windows machine.

Thank you for stopping by!

💖 💪 🙅 🚩
arun3sh
Arunesh Choudhary

Posted on April 26, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related