mysql
mysql-5.7.35 aarch64安装
mysql-5.7.35 aarch64 性能测试
mysql笔记
Centos7-mysql-8.0.24-rpm(aarch)编译安装
centos8编译mysql
-
+
首页
centos8编译mysql
``` #!/bin/bash #centos8编译mysql的rpm包并利用sftp上传脚本 ######################变量########################## config=https://downloads.mysql.com/archives/get/p/23/file/mysql-community-5.7.32-1.el7.src.rpm #截取名称,截取包名-版本,为编译与传输做准备,这是该组件通用,不用修改; var=$config #5.7.32-1.el7.src.rpm rpmname="`echo ${var#*community-}`" #5.7.32 version="`echo ${rpmname%-*}`" #mysql-5.7.32.tar.gz package="mysql-`echo $version`.tar.gz" #获取解压后的包 #mysql-5.7.32 var2="mysql-`echo $version`" #为修改mysqld.cc做准备 route="`echo $var2`/sql/mysqld.cc" #获取大版本 bigver="`echo ${version%%.*}`" #连接sftp user=sftp passwd='sftp' port=18884 ip=192.168.0.173 #传输目的地 addr='/sftp/centos8/rpm' #依赖安装 yum install time libaio-devel ncurses-devel numactl-devel openssl-devel zlib-devel cyrus-sasl-devel openldap-devel perl-Env perl-Env.noarch cmake cmake3 gcc gcc-c++ make rpm-build vim perl-devel autoconf libaio perl-JSON.noarch perl-Data-Dumper perl wget bison perl-JSON libtirpc-devel automake libarchive -y yum install epel-release -y centos8安装rpcgen #配源 curl -o /etc/yum.repos.d/openEulerOS.repo https://repo.huaweicloud.com/repository/conf/openeuler_aarch64.repo yum install -y rpcgen mv /etc/yum.repos.d/openEulerOS.repo /etc/yum.repos.d/openEulerOS.repo.bak if [ $bigver -eq 5 ];then echo "正在centos8编译大版本为5的mysql" else echo "正在centos8编译大版本为8的mysq" #gcc高版本快速安装,防止修改MySQL源码包里的cmake配置文件 yum install devtoolset-10 -y source /opt/rh/devtoolset-10/enable #gcc -v fi wget $var rpm -ivh *.rpm #执行编译#4表示并发数,要小于内存除以2G ,例如16G内存,则并发数小于8,_smp_mflags -j4 等于同时使用4个内核去并发执行。 rpmbuild -bb --define '_smp_mflags -j4' /root/rpmbuild/SPECS/mysql.spec yum install createrepo -y createrepo /root/rpmbuild/RPMS/aarch64 cd /root/rpmbuild/RPMS/ mkdir $var2 cd /root/rpmbuild/RPMS/aarch64/ cp -r * ../$var2 #利用sftp传输脚本生成的包 yum install vim wget -y yum install glibc-headers gcc-c++ make unzip -y cd /opt #编译tcl,expect编译依赖tcl wget http://core.tcl.tk/tcl/zip/release/tcl.zip unzip tcl.zip cd ./tcl/unix ./configure && make -j4 && make install cd /opt #编译expect,expect提供了shell中的人机交互 wget https://jaist.dl.sourceforge.net/project/expect/Expect/5.45.3/expect5.45.3.tar.gz --no-check-certificate tar -xzvf expect5.45.3.tar.gz && cd expect5.45.3/ ./configure --build=arm-linux && make -j4 && make install #安装sftp,传输需要 yum install openssh-clients -y cd /root/rpmbuild/RPMS #利用expect工具和sftp协议进行传输编译的包 /usr/local/bin/expect <<-EOF set timeout -1 spawn sftp -oPort=$port $user@$ip expect { "yes/no" { send "yes\r"; exp_continue } "Password:" { send "$passwd\r"; exp_continue } "sftp" { send "put -r ./$var2/ $addr\r" } } send "exit\r" expect eof EOF echo "make over finishjrt"
JRT
2021年12月28日 16:30
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
Markdown文件
分享
链接
类型
密码
更新密码