参考地址:https://downloads.mariadb.org/mariadb/repositories/#mirror=shanghai-university

1. 选择操作系统centos7

2.创建repo文件

输入内容;
# MariaDB 10.3 CentOS repository list - created 2018-06-05 06:27 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
然后进行安装
sudo yum install MariaDB-server MariaDB-client

启动mariadb

systemctl start mariadb

设置开机启动
systemctl enable mariadb
初始化
mysql_secure_installation
登陆
mysql -uroot -p password