MariaDB 10.11 升级到11.4

MariaDB 10.11 升级到11.4直接通过yum升级提示错误

error: %prein(MariaDB-server-11.4.3-1.el9.x86_64) scriptlet failed, exit status 1

Error in PREIN scriptlet in rpm package MariaDB-server
Verifying : MariaDB-server-11.4.3-1.el9.x86_64 1/2
Verifying : MariaDB-server-10.11.9-1.el9.x86_64 2/2

Failed:
MariaDB-server-10.11.9-1.el9.x86_64 MariaDB-server-11.4.3-1.el9.x86_64

Error: Transaction failed

 

升级前记得备份 备份mariadb配置文件和相关数据数据

添加MariaDB yum源

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

# MariaDB 11.4 CentOS repository list - created 2024-04-07 00:55 UTC
# https://mariadb.org/download/
[mariadb]
name = MariaDB
baseurl = https://mirrors.ustc.edu.cn/mariadb/yum/11.4/rocky9-amd64/
module_hotfixes=1
gpgkey=https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1

停止数据并卸载原有数据库

systemctl stop mariadb

dnf remove MariaDB-server

安装新版本数据库并启动\设置开机启动

dnf install MariaDB-server

systemctl start mariadb

systemctl enable mariadb

检查原有程序系统是否能正常使用,并升级数据库文件

mariadb-upgrade -u root -p

最后查看相关是否允许正常