2、实战:源码编译安装mariadb(10.2.19)-2024.4.18(测试成功)
实战:源码编译安装mariadb(10.2.19)-2024.4.18(测试成功)
目录
[toc]
实验环境
centos7.6 1810
mariadb(10.2.19)
实验软件
链接:https://pan.baidu.com/s/1qN4WGr8yvPn2VYrkB5rW9Q?pwd=o9av
提取码:o9av
2024.4.18-实战:源码编译安装mariadb(10.2.19)-2024.4.18(测试成功)
安装相关依赖包
yum -y install bison bison-devel zlib-devel libcurl-devel libarchive-devel boost-devel gcc gcc-c++ cmake ncurses-devel gnutls-devel libxml2-devel openssl-devel libevent-devel libaio-devel
做准备用户和数据目录
useradd -r -s /sbin/nologin -d /data/mysql mysql
准备数据库目录
mkdir -p /data/mysql
chown mysql.mysql /data/mysql
源码编译安装
- 下载并解压缩源码包
tar xvf mariadb-10.2.19.tar.gz
- 源码编译安装mariadb
cd mariadb-10.2.19/
cmake . \
-DCMAKE_INSTALL_PREFIX=/app/mysql \
-DMYSQL_DATADIR=/data/mysql/ \
-DSYSCONFDIR=/etc/ \
-DMYSQL_USER=mysql \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITHOUT_MROONGA_STORAGE_ENGINE=1 \
-DWITH_DEBUG=0 \
-DWITH_READLINE=1 \
-DWITH_SSL=system \
-DWITH_ZLIB=system \
-DWITH_LIBWRAP=0 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci
#make && make install
make -j 8 && make install; date