CentOS 7 升級 MariaDB 10.2 到 10.5
#查看版本
mysql -V
#mysql Ver 15.1 Distrib 5.5.68-MariaDB, for Linux (x86_64) using readline 5.1
#備份資料庫
mysqldump -u root -p --all-database > all.sql
#備份MariaDB設定
cp /etc/my.cnf /etc/my.cnf.bak
#設定 MariaDB 的 YUM Repo
vim /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
#停止MariaDB
systemctl stop mariadb
#移除MariaDB
yum remove mariadb mariadb-server -y
#安裝新版MariaDB
yum install mariadb mariadb-server -y
systemctl enable mariadb
systemctl start mariadb
#MariaDB資料升級
mysql_upgrade -u root -p