备份数据
mysqldump -u root -p --all-databases > alldb.sql
cp /etc/my.conf /etc/my.conf.bak.202001211700
增加源
# /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = https://mirrors.ustc.edu.cn/mariadb/yum/10.5/centos7-amd64
gpgkey=https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1
重置源缓存
yum clean all
yum makecache all
卸载旧版本
systemctl stop mariadb
yum remove mariadb mariadb-server
安装新版本
# 安装新版本
yum install mariadb mariadb-server
# 设为开机启动
systemctl enable mariadb
# 启动 MariaDB
systemctl start mariadb
# 升级已有数据库
mysql_upgrade -uroot -p
Upgrading from MariaDB 5.5 to MariaDB 10.0