参考文章
机器环境:4.19.90-25.4.v2101.ky10.aarch64 (银河麒麟v10 sp2)
数据库版本:mysql-5.7.36
1.查看是否安装mariadb,若是已安装,需要卸载
#要是有,需要卸载
[root@localhost zswl]# rpm -qa|grep mariadb
mariadb-common-10.3.9-11.p01.ky10.aarch64
mariadb-errmessage-10.3.9-11.p01.ky10.aarch64
mariadb-connector-c-3.0.6-7.ky10.aarch64
mariadb-server-10.3.9-11.p01.ky10.aarch64
mariadb-10.3.9-11.p01.ky10.aarch64
#卸载mariadb相关
[root@localhost zswl]# yum remove mariadb
[root@localhost zswl]# rpm -qa|grep mariadb
2.下载源码包,上传解压
wget https://cdn.mysql.com/archives/mysql-5.7/mysql-boost-5.7.36.tar.gz
mysql官方下载地址:https://downloads.mysql.com/archives/community/
如下图,我们要源码编译安装
选择mysql-5.7.36.tar.gz或者mysql-boost-5.7.36.tar.gz(这个MySQL源码包里包含了boost)
如果选择mysql-5.7.36.tar.gz这个源码包,就必须要下载一个boost库包boost_1_59_0.tar(否则预编译时会通不过报错)。
3.yum安装编译所需要的工具和库
[root@localhost mysql-5.7.36]# yum install gcc gcc-c++ cmake ncurses-devel bison openssl-devel rpcgen
kylinsp2 217 kB/s | 3.8 kB 00:00
上次元数据过期检查:0:00:01 前,执行于 2023年01月29日 星期日 13时28分38秒。
软件包 gcc-7.3.0-20190804.35.p02.ky10.aarch64 已安装。
软件包 gcc-c++-7.3.0-20190804.35.p02.ky10.aarch64 已安装。
软件包 cmake-3.16.5-4.p01.ky10.aarch64 已安装。
软件包 ncurses-devel-6.2-1.ky10.aarch64 已安装。
软件包 bison-3.6.4-1.ky10.aarch64 已安装。
软件包 openssl-devel-1:1.1.1f-4.p04.ky10.aarch64 已安装。
未找到匹配的参数: rpcgen
错误:没有任何匹配: rpcgen
rpcgen未安装,单独下载安装
[root@localhost rpcsvc-proto-1.4]# wget https://github.com/thkukuk/rpcsvc-proto/releases/download/v1.4/rpcsvc-proto-1.4.tar.gz
tar xf rpcsvc-proto-1.4.tar.gz
cd rpcsvc-proto-1.4
./configure
make
make install
编译过程
[root@localhost rpcsvc-proto-1.4]# ./configure
configure: loading site script /usr/share/config.site
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether gcc and cc understand -c and -o together... yes
checking how to run the C preprocessor... gcc -E
checking for library containing strerror... none required
checking whether make sets $(MAKE)... (cached) yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating rpcgen/Makefile
config.status: creating rpcsvc/Makefile
config.status: creating config.h
config.status: executing depfiles commands
[root@localhost rpcsvc-proto-1.4]# make
make all-recursive
make[1]: 进入目录“/home/zswl/test/rpcsvc-proto-1.4”
Making all in rpcgen
make[2]: 进入目录“/home/zswl/test/rpcsvc-proto-1.4/rpcgen”
gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT rpc_clntout.o -MD -MP -MF .deps/rpc_clntout.Tpo -c -o rpc_clntout