[root@centos7-1 ~]$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
[root@centos7-1 ~]$lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 8
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 94
[root@centos7-1 ~]$useradd -r -s /sbin/nologin -d /data/mysql mysql
[root@centos7-1 ~]$mkdir /data/mysql
[root@centos7-1 ~]$chown mysql.mysql /data/mysql/
[root@centos7-1 ~]$tar xf mariadb-10.5.5.tar.gz
[root@centos7-1 ~]$cd mariadb-10.5.5
[root@centos7-1 mariadb-10.5.5]$cmake .
> -DCMAKE_INSTALL_PREFIX=/usr/local/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
[root@centos7-1 mariadb-10.5.5]$make -j 8;make install
提示:如果出错,执行rm -f CMakeCache.txt
[root@centos7-1 mariadb-10.5.5]$echo 'PATH=/usr/local//mysql/bin:$PATH ' > /etc/profile.d/mysql.sh
[root@centos7-1 mariadb-10.5.5]$source /etc/profile.d/mysql.sh
[root@centos7-1 mariadb-10.5.5]$/usr/local/mysql/scripts/mysql_install_db --datadir=/var/lib/mysql --user=mysql
[root@centos7-1 mariadb-10.5.5]$cp -a /usr/local/mysql/support-files/wsrep.cnf /etc/my.cnf
[root@centos7-1 mariadb-10.5.5]$cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
[root@centos7-1 ~]$chkconfig --add mysqld
[root@centos7-1 ~]$service mysqld start
Starting mysqld (via systemctl):
[ OK ]
[root@centos7-1 ~]$/usr/local/mysql/bin/mysql_secure_installation
[root@centos7-1 ~]$mysql -uroot -ptianze