安装MariaDB
yum install -y mariadb mariadb-server
启动程序
systemctl start mariadb
启动管理客户端
mysql
启动远程连接
grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
flush privileges;
配置数据库
修改数据存储目录
# 创建数据目录
mkdir /data/mysql
mkdir /data/mysql/data
mkdir /data/mysql/logs
# 目录授权
# chmod 777 /data/mysql/
chown -R mysql:mysql /data/mysql/
vi /etc/my.cnf
[mysqld]
datadir=/data/mysql/data
socket=/data/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[mysqld_safe]
log-error=/data/mysql/logs/mariadb.log
pid-file=/data/mysql/mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
关闭SELinux
临时关闭,不用重启
setenforce 0
永久关闭
vi /etc/selinux/config
SELINUX=disabled