CentOS 7 升级或新安装MariaDB 10.5,使用阿里云镜像

先进行系统更新

yum update -y

编辑yum配置文件,使用阿里云镜像

  • 这里以 MariaDB 10.5为例
vim /etc/yum.repos.d/MariaDB10.repo

#http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = https://mirrors.aliyun.com/mariadb/yum/10.5/centos7-amd64
gpgkey = https://mirrors.aliyun.com/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck = 1

停止当前的MariaDB服务

systemctl stop mariadb

删除旧的MariaDB安装包

yum remove mariadb-server mariadb mariadb-libs
yum clean all

安装 MariaDB 10

yum install MariaDB-server MariaDB-client

启动并设置自动启动MariaDB

systemctl start mysql
systemctl enable mysql

升级旧 MariaDB 数据库

mysql_upgrade -uroot -p123456

检查是否安装成功

mysql --version
mysql -uroot -p123456

参考
How to Upgrade MariaDB 5.5 to MariaDB 10.0 on CentOS 7
MariaDB 镜像