由于篇幅原因,我们在「MySQL专栏」redhat8中Mysql源码编译安装之环境准备工作中介绍了mysql编译安装的环境准备工作,下面我们来看看mysql编译安装的具体过程。#MySQL专栏#
CMAKE编译
[root
localhostmysqlsetup]#tar-xzvfmysql-boost-5.7.34.tar.gz[root
localhostmysqlsetup]#lsmysql-5.7.34mysql-boost-5.7.34.tar.gzrpcsvc-proto-1.4.1rpcsvc-proto-1.4.1.tar
[root
localhostmysqlsetup]#cdmysql-5.7.34/[root
localhostmysql-5.7.34]#cmake-DCMAKE_INSTALL_PREFIX=/soft/mysql/svr/mysql57-DMYSQL_DATADIR=/soft/mysql/dbdat/mysql57_-DSYSCONFDIR=/soft/mysql/conf/mysql-DWITH_BOOST=/soft/mysqlsetup/mysql-5.7.34/boost/boost_1_59_0-DDEFAULT_CHARSET=utf8mb4-DDEFAULT_COLLATION=utf8mb4_unicode_ci-DEXTRA_CHARSETS=all-DENABLED_LOCAL_INFILE=1-DMYSQL_UNIX_ADDR=/tmp/mysql.sock-DMYSQL_TCP_PORT=-DWITH_SYSTEMD=1等待编译完成。
make编译
[root
localhostmysql-5.7.34]#make-j4--make编译,可以添加-j参数,多线程编译
编译直至完成,无任何报错。
makeinstall安装
[root
localhostmysql-5.7.34]#makeinstall以上就是MySQL编译安装的完整过程。