1 检查环境
iptables
selinux
mariadb-server
2 下载二进制包
3 useradd -r -d /data/mysqldb -s /sbin/nologin mysql
4 tar xvf mariadb-10.2.15-linux-x86_64.tar.gz -C /usr/local/
cd /usr/local
ln -s mariadb-10.2.15-linux-x86_64/ mysql
chown -R root:root mysql/
5 echo PATH=/usr/local/mysql/bin:$PATH > /etc/profile.d/mysql.sh
. /etc/profile.d/mysql.sh
6 mkdir -pv /data/mysqldb
chown mysql.mysql /data/mysqldb
chmod 770 /data/mysqldb
7
cd /usr/local/mysql
scripts/mysql_install_db --datadir=/data/mysqldb --user=mysql
8
cd /usr/local/mysql
cp support-files/my-huge.cnf /etc/my.cnf
vim /etc/my.cnf
[mysqld]
datadir=/data/mysqldb 加此行
9
cd /usr/local/mysql
cp support-files/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
service mysqld start
10 安全加固
mysql_secure_installation