一、安装mariadb 二进制 tar xvf mariadb-10.1.8-linux-glibc_214-x86_64.tar.gz -C /usr/local/ cd /usr/local/ ln -sv mariadb-10.1.8-linux-x86_64/ mysql id mysql || useradd -r mysql cd mysql chown root:mysql ./* mkdir /mydata/data/ -pv chown mysql.mysql /mydata/data/ -R cp support-files/mysql.server /etc/rc.d/init.d/mysqld chmod +x chkconfig --add mysqld
mkdir /etc/mysql cp support-files/my-large.cnf /etc/mysql/my.cnf vim my.cnf [mysqld] data_dir = /mydata/data skip_name_resolve = on innodb_file_per_table = on
scripts/mysql_install_db --user=mysql --skip-name-resolve --datadir=/mydata/data service mysqld start 后续: vim /etc/profile.d/mysql.sh export PATH=/usr/local/mysql/bin:$PATH . /etc/profile.d/mysql.sh
vim /etc/ld.so.conf.d/mysql.conf /usr/local/mysql/lib ldconfig ldconfig -p |grep mysql
ln -sv /usr/local/mysql/include/ /usr/include/ 错误:libjemalloc.so.1: cannot open shared object file: No such file or directory libjemalloc.so.1 //找不到 yum install jemalloc -y