-
Notifications
You must be signed in to change notification settings - Fork 56
Building MySQL 8.0.x
Below versions of MySQL are available in respective distributions at the time creation of these build instructions:
- RHEL (8.8, 8.10, 9.2, 9.4, 9.5) have
8.0.41
- Ubuntu (20.04, 22.04, 24.04) have
8.0.41
The instructions provided below specify the steps to build MySQL version 8.0.41 on Linux on IBM Z for the following distribution:
- SLES 15 SP6
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.
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/8.0.41/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.
export SOURCE_ROOT=/<source_root>/
export PATCH_URL=https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/MySQL/8.0.41/patch
sudo zypper install -y curl make cmake bison gcc14 gcc14-c++ git hostname ncurses-devel procps openssl-devel pkg-config gawk doxygen libtirpc-devel rpcgen tar wget net-tools-deprecated xz timezone
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-14 14
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 14
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 14
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-14 14
sudo ln -sf /usr/bin/gcc /usr/bin/s390x-linux-gnu-gcc
sudo ln -sf /usr/bin/cpp-14 /usr/bin/cpp
cd $SOURCE_ROOT
git clone -b mysql-8.0.41 https://github.com/mysql/mysql-server.git
cd mysql-server
curl -sSL "${PATCH_URL}/NdbHW.patch" | git apply -
curl -sSL "${PATCH_URL}/router-test.patch" | git apply -
curl -sSL "${PATCH_URL}/ut0rnd.patch" | git apply -
mkdir build
cd build
cmake .. -DDOWNLOAD_BOOST=1 -DWITH_BOOST=. -DWITH_SSL=system
make -j $(nproc)
sudo make install
Note: For more MySQL source configuration options, please visit their official guide.
- Use the below command to run the whole test suite:
cd $SOURCE_ROOT/mysql-server/build
export LD_PRELOAD=$SOURCE_ROOT/mysql-server/build/library_output_directory/libprotobuf-lite.so.24.4.0:$LD_PRELOAD # To fix routertest test failures
make test
- Use the below command to run an individual test case (for example
routertest_component_routing_splicer
):
ctest -VV -R routertest_component_routing_splicer
Note:
-
Below test cases might fail if IPv6 is not enabled:
- NdbGetInAddr-t
- routertest_harness_net_ts_internet
- routertest_component_http_server
Refer to this guide for the Postinstallation Setup and Testing overview.
- https://dev.mysql.com/doc/refman/8.0/en/ - MySQL 8.0 Reference Manual
- https://dev.mysql.com/doc/refman/8.0/en/source-installation.html - Installing MySQL from Source
The information provided in this article is accurate at the time of writing, but on-going development in the open-source projects involved may make the information incorrect or obsolete. Please open issue or contact us on IBM Z Community if you have any questions or feedback.