鲲鹏平台ARM版centos安装源码包mysql5.7(一)
系统版本为:
CentOS Linux release 7.6.1810 (AltArch)
Linux ecs-1b82 4.18.0-80.7.2.el7.aarch64 #1 SMP Thu Sep 12 16:13:20 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux
1,升级gcc
1.1安装解压缩,下载工具。
yum install -y bzip2 wget -y
1.2下载GCC和相关依赖包
相关软件包:gmp-6.1.0.tar.bz2,isl-0.16.1.tar.bz2,mpc-1.0.3.tar.gz,mpfr-3.1.4.tar.bz2,gcc-7.3.0.tar.gz
--下载gcc-7.3
wget https://mirrors.tuna.tsinghua.edu.cn/gnu/gcc/gcc-7.3.0/gcc-7.3.0.tar.gz
--下载依赖包
tar xvf gcc-7.3.0.tar.gz
cd gcc-7.3.0
wget https://gcc.gnu.org/pub/gcc/infrastructure/gmp-6.1.0.tar.bz2
wget https://gcc.gnu.org/pub/gcc/infrastructure/isl-0.16.1.tar.bz2
wget https://gcc.gnu.org/pub/gcc/infrastructure/mpc-1.0.3.tar.gz
wget https://gcc.gnu.org/pub/gcc/infrastructure/mpfr-3.1.4.tar.bz2
1.3 检查gcc软件环境和依赖包
[root@ecs-1b82 gcc-7.3.0]# ./contrib/download_prerequisites
gmp-6.1.0.tar.bz2: OK
mpfr-3.1.4.tar.bz2: OK
mpc-1.0.3.tar.gz: OK
isl-0.16.1.tar.bz2: OK
All prerequisites downloaded successfully.
1.4编译安装
[root@ecs-3bc5 gcc-7.3.0]# mkdir tmp
[root@ecs-3bc5 gcc-7.3.0]# cd tmp/
[root@ecs-3bc5 tmp]# ../configure --enable-checking=release --enable-language=c,c++ --disable-multilib --prefix=/usr
[root@ecs-3bc5 tmp]# make -j16 #根据CPU个数决定,lscpu查看cpu个数。
[root@ecs-3bc5 tmp]# make install
1.5 版本检测
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/aarch64-unknown-linux-gnu/7.3.0/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: ../configure --enable-checking=release --enable-language=c,c++ --disable-multilib --prefix=/usr
Thread model: posix
gcc version 7.3.0 (GCC)
2,mysql安装
2.1 mysql依赖软件安装
yum install cmake -y
yum install ncurses* -y
yum install openssl* -y
yum install libaio* -y
2.2 mysql安装包下载
https://dev.mysql.com/downloads/mysql/5.7.html#downloads
建议下载boost版本。否则需要单独联网下载boost依赖包。
wget -c http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-boost-5.7.28.tar.gz
2.3 解压软件进入安装目录
tar xvf mysql-boost-5.7.28.tar.gz
cd mysql-5.7.28/
2.4 进入mysql源码文件,mysql软件安装
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/data/data \
-DSYSCONFDIR=/etc \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DENABLE_DTRACE=0 \
-DDEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_general_ci \
-DWITH_EMBEDDED_SERVER=1 \
-DDOWNLOAD_BOOST=1 \
-DWITH_BOOST=./boost/boost_1_59_0
make -j16 #根据主机CPU个数设置相关数值。
make install
//make相关报错处理:
#make报错信息:
[100%] Building CXX object sql/CMakeFiles/sql.dir/mysqld_daemon.cc.o
/home/mysql-5.7.28/sql/mysqld.cc: In function ?.asswd* check_user(const char*)?.
/home/mysql-5.7.28/sql/mysqld.cc:1565:12: error: ?.rctl?.was not declared in this scope
(void) prctl(PR_SET_DUMPABLE, 1);
^~~~~
make[2]: *** [sql/CMakeFiles/sql.dir/mysqld.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[100%] Built target mysql_client_test_embedded
make[1]: *** [sql/CMakeFiles/sql.dir/all] Error 2
make: *** [all] Error
#解决方法:
修改mysql-5.7.28/sql/mysqld.cc文件,添加一行#include <sys/prctl.h>既可。
3,mysql版本检查
/usr/local/mysql/bin/mysql --version
- 点赞
- 收藏
- 关注作者
评论(0)