vi /etc/yum.repos.d/MariaDB.repo

添加

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1


运行

yum clean all && yum makecache all
yum install MariaDB-server MariaDB-client -y