Building MySQL 5.x - linux-on-ibm-z/docs GitHub Wiki

Building MySQL 5.x

The instructions provided below specify the steps to build MySQL version 5.7.44 on Linux on IBM Z for the following distributions:

  • RHEL (7.8, 7.9)
  • SLES 12 SP5

General Notes:

  • When following the steps below please use a standard permission user unless otherwise specified.
  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.

Building MySQL

Step 1: Build using script

If you want to build MySQL using manual steps, go to Step 2.

Use the following commands to build MySQL using the build script. Please make sure you have wget installed.

wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/MySQL/5.7.44/build_mysql.sh
# Build MySQL
bash build_mysql.sh   [Provide -t option for executing build with tests]

If the build completes successfully, go to STEP 4. In case of error, check logs for more details or go to STEP 2 to follow manual build steps.

Step 2: Install the dependencies

export SOURCE_ROOT=/<source_root>/
  • RHEL (7.8, 7.9)

    sudo yum install -y bison cmake gcc gcc-c++ git hostname make ncurses-devel openssl openssl-devel
    
  • SLES 12 SP5

    sudo zypper install -y bison cmake gawk gcc gcc-c++ git-core libopenssl-devel make libyui-ncurses-devel
    

Step 3: Build MySQL

3.1) Download the MySQL source code from Github

cd $SOURCE_ROOT
git clone https://github.com/mysql/mysql-server
cd mysql-server
git checkout mysql-5.7.44
mkdir build
cd build

3.2) Configure MySQL

 cmake .. -DDOWNLOAD_BOOST=1 -DWITH_BOOST=. -DWITH_SSL=system

Note: For more MySQL source configuration options, please visit their official guide.

3.3) Build and Install MySQL

make
sudo make install

3.4) Run unit tests (Optional)

The testing should take only a few seconds.

make test

Step 4: Post installation setup (Optional)

Refer to this guide for the Postinstallation Setup and Testing overview.

Clean up (Optional)

cd $SOURCE_ROOT
rm -rf mysql-server

References: