安装CMAKE
下载CMAKEhttps://cmake.org/download/
-
解压文件
tar -zxvf cmake-3.6.0-rc3.tar.gz
-
安装GCC
yum install gcc-c++
-
切换到cmake目录
cd cmake-3.6.0-rc3
-
执行configure文件
./configure
-
安装
make && make install
安装mariadb
下载mariadb[https://downloads.mariadb.org...]()
-
解压文件
tar -zxvf mariadb-10.1.14.tar.gz
-
切换到mariadb目录
cd mariadb-10.1.14
-
groupadd MysqL useradd -g MysqL MysqL
-
创建安装目录和数据目录
mkdir /usr/local/mariadb mkdir /usr/local/mariadb/data chown -R MysqL:MysqL /usr/local/mariadb
-
安装ncurses-devel
yum install ncurses-devel
-
编译
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mariadb -DMysqL_DATADIR=/usr/local/mariadb/data -DMysqL_USER=MysqL -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
-
安装
make && make install
-
rm -f /etc/my.cnf cp /usr/local/mariadb/support-files/my-large.cnf /etc/my.cnf
-
初始化数据库
/usr/local/mariadb/scripts/MysqL_install_db --user=MysqL --basedir=/usr/local/mariadb --datadir=/usr/local/mariadb/data
-
添加环境变量
运行命令打开系统文件
vi /etc/profile
在最后加上
MysqL_HOME=/usr/local/mariadb PATH=$MysqL_HOME/bin:$PATH export PATH
-
mariadb开机自启动
cp /usr/local/mariadb/support-files/MysqL.server /etc/init.d/MysqLd chkconfig --add MysqLd