一、准备工作
https://mariadb.org/mariadb/all-releases/
选择想要安装的版本,再选择MariaDB Respositories,复制yum源信息
二、先确认当前环境是否安装过数据库
[root@localhost ~]# rpm -q mariadb-server package mariadb-server is not installed
三、重新配置yum仓库
# vim /etc/yum.repos.d/MariaDB.repo
将复制的yum源信息填写到MariaDB.repo
[mariadb] name = MariaDB baseurl = https://tw1.mirror.blendbyte.net/mariadb/yum/10.6/centos7-amd64 gpgkey=https://tw1.mirror.blendbyte.net/mariadb/yum/RPM-GPG-KEY-MariaDB gpgcheck=1
查看已安装好的yum源仓库
[root@localhost yum.repos.d]# yum repolist Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile base | 3.6 kB 00:00:00 epel | 4.7 kB 00:00:00 extras | 2.9 kB 00:00:00 mariadb | 3.4 kB 00:00:00 updates | 2.9 kB 00:00:00 (1/2): mariadb/updateinfo | 5.4 kB 00:00:01 (2/2): mariadb/primary_db | 66 kB 00:00:01 repo id repo name status base/7/x86_64 CentOS-7 10,072 epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13,674 extras/7/x86_64 CentOS-7 500 mariadb MariaDB 93 updates/7/x86_64 CentOS-7 2,943 repolist: 27,282
四、yum安装mariadb服务端
# yum install -y mariadb-server
[root@localhost yum.repos.d]# mariadb --version mariadb Ver 15.1 Distrib 10.6.4-MariaDB, for Linux (x86_64) using readline 5.1
五、安装后,运行安全加固(过程略)
可参考:
简单快速安装Apache+PHP+MySql服务环境(一)
https://www.cnblogs.com/iverson-3/p/11198712.html