Bug #115514 mysql version 8.0.38 taking long time to compile
Submitted: 4 Jul 2024 13:25 Modified: 4 Jul 2024 13:29
Reporter: Amol Arote Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.0.38 OS:CentOS (7)
Assigned to: CPU Architecture:x86 (xeon)

[4 Jul 2024 13:25] Amol Arote
Description:
Hi,

I tried to compile mysql version 8.0.38 on centos 7.9 with below steps, but make command its taking aprox 4hrs to complete.

yum install zlib

yum install zlib-devel

yum install gcc

yum install gcc-c++

yum install ncurses

yum install ncurses-devel

yum install openssl

yum install openssl-devel

yum install libaio

yum install libaio-devel

yum install bzr

yum install m4

yum install bison

yum install perl

yum install perl-Data-Dumper

yum install cmake3

yum install centos-release-scl

yum install devtoolset-11-gcc devtoolset-11-gcc-c++

cd /opt/	

groupadd mysql

useradd -g mysql mysql

wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-8.0.38.tar.gz

tar -zxvf mysql-boost-8.0.38.tar.gz

mkdir /opt/mysql-8.0.38/build

cd mysql-8.0.38/build/

cmake3 ../ -DCMAKE_INSTALL_PREFIX=/opt/mysql    -DMYSQL_DATADIR=/opt/mysql/data -DWITH_BOOST=/opt/mysql-8.0.37/boost/boost_1_77_0/

make

make install

cd /opt/mysql

cp support-files/mysql.server /etc/init.d/mysqld

chmod +x /etc/init.d/mysqld

chkconfig --add mysqld
    chkconfig --list | grep mysqld 

chown -R mysql  .

chgrp -R mysql  .

copy my.cnf from old server

mysqld --initialize --user=mysql --datadir=/opt/mysql/data/

chown -R mysql  .

chgrp -R mysql  .

bin/mysqld_safe --user=mysql &

cat /opt/mysql/data/mysql-error.log

Please let me know anything is wrong

How to repeat:
at time of fresh installation
[4 Jul 2024 13:29] MySQL Verification Team
HI MR. ARote,

Thank you for your bug report.

However, it does take time to build latest 8.0.

Hence, it is expected behaviour.

That is why we recommend to you, very strongly, to use our official binaries from https://dev.mysql.com.

Not a bug.
[5 Jul 2024 6:41] Terje Røsten
Please try to -j option to make command, e.g. to use number of CPUS on system:

make -j$(nproc)
[5 Jul 2024 9:41] MySQL Verification Team
Thank you, Terje, that is a good comment.
[8 Jul 2024 10:17] Laurynas Biveinis
I will shamelessly plug my blog here:
https://of-code.blogspot.com/2023/08/mysql-build-times-use-ninja.html
https://of-code.blogspot.com/2023/05/mysql-compilation-and-testsuite-run-tips.html
In the latter specifically the "Build options" section.
[8 Jul 2024 10:32] MySQL Verification Team
Thank you, Mr. Biveinis.