You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

CentOS 7.9环境下通过YUM升级MariaDB从10.2到11.0失败的问题求助

CentOS 7.9环境下通过YUM升级MariaDB从10.2到11.0失败的问题求助

我把MariaDB的软件源从10.2版本切换到11版本后,执行yum update尝试升级时遇到了报错,无法完成MariaDB-server的更新或移除操作,具体情况如下:

执行yum -y update的报错输出

-bash-# yum -y update

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

Resolving Dependencies

--> Running transaction check

---> Package MariaDB-server.x86_64 0:10.2.41-1.el7.centos will be updated

---> Package MariaDB-server.x86_64 0:11.0.1-1.el7.centos will be an update

--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================

Package                                 Arch                            Version                                      Repository                        Size

=============================================================================================================================================================

Updating:

MariaDB-server                          x86_64                          11.0.1-1.el7.centos                          mariadb                           27 M

Transaction Summary

=============================================================================================================================================================

Upgrade  1 Package

Total download size: 27 M

Downloading packages:

No Presto metadata available for mariadb

MariaDB-server-11.0.1-1.el7.centos.x86_64.rpm                                                                                         |  27 MB  00:02:42

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

******************************************************************

A MySQL or MariaDB server package (MariaDB-server-10.2.41-1.el7.centos.x86_64) is installed.

Upgrading directly from MySQL 10.2 to MariaDB 11.0 may not

be safe in all cases.  A manual dump and restore using mysqldump is

recommended.  It is important to review the MariaDB manual's Upgrading

section for version-specific incompatibilities.

A manual upgrade is required.

- Ensure that you have a complete, working backup of your data and my.cnf

files

- Shut down the MySQL server cleanly

- Remove the existing MySQL packages.  Usually this command will

list the packages you should remove:

rpm -qa | grep -i '^mysql-'

You may choose to use 'rpm --nodeps -ev <package-name>' to remove

the package which contains the mysqlclient shared library.  The

library will be reinstalled by the MariaDB-shared package.

- Install the new MariaDB packages supplied by MariaDB Foundation

- Ensure that the MariaDB server is started

- Run the 'mysql_upgrade' program

This is a brief description of the upgrade process.  Important details

can be found in the MariaDB manual, in the Upgrading section.

******************************************************************

error: %pre(MariaDB-server-11.0.1-1.el7.centos.x86_64) scriptlet failed, exit status 1

Error in PREIN scriptlet in rpm package MariaDB-server-11.0.1-1.el7.centos.x86_64

MariaDB-server-10.2.41-1.el7.centos.x86_64 was supposed to be removed but is not!

Verifying  : MariaDB-server-10.2.41-1.el7.centos.x86_64                                                                                                1/2

Verifying  : MariaDB-server-11.0.1-1.el7.centos.x86_64                                                                                                 2/2

Failed:

MariaDB-server.x86_64 0:10.2.41-1.el7.centos                                  MariaDB-server.x86_64 0:11.0.1-1.el7.centos

Complete!

尝试移除旧版本10.2时的报错

-bash-# sudo yum remove MariaDB-server galera

Loaded plugins: fastestmirror

No Match for argument: galera

Resolving Dependencies

--> Running transaction check

---> Package MariaDB-server.x86_64 0:10.2.41-1.el7.centos will be erased

--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================

Package                                Arch                           Version                                        Repository                        Size

=============================================================================================================================================================

Removing:

MariaDB-server                         x86_64                         10.2.41-1.el7.centos                           @mariadb                         117 M

Transaction Summary

=============================================================================================================================================================

Remove  1 Package

Installed size: 117 M

Is this ok [y/N]: y

Downloading packages:

Running transaction check

ERROR with transaction check vs depsolve:

MariaDB-server >= 11.0.0 is needed by (installed) MariaDB-server-compat-11.0.1-1.el7.centos.noarch

** Found 4 pre-existing rpmdb problem(s), 'yum check' output follows:

MariaDB-client-11.0.1-1.el7.centos.x86_64 has installed conflicts MariaDB-server < ('0', '11.0.0', None): MariaDB-server-10.2.41-1.el7.centos.x86_64

MariaDB-common-11.0.1-1.el7.centos.x86_64 has installed conflicts MariaDB-server < ('0', '10.6.1', None): MariaDB-server-10.2.41-1.el7.centos.x86_64

MariaDB-server-10.2.41-1.el7.centos.x86_64 has missing requires of galera

MariaDB-server-compat-11.0.1-1.el7.centos.noarch has missing requires of MariaDB-server >= ('0', '11.0.0', None)

Your transaction was saved, rerun it with:

yum load-transaction /tmp/yum_save_tx.2023-04-10.16-35.Pz_MRr.yumtx

当前无法正常使用的命令

-bash-# mysql
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
ERROR 2002 (HY000): Can't connect to local server through socket '/var/lib/mysql/mysql.sock' (2)

-bash-# mysql_upgrade
-bash: mysql_upgrade: command not found

当前MariaDB服务状态

-bash-# systemctl status mariadb.service
* mariadb.service - MariaDB 10.2.41 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
`-migrated-from-my.cnf-settings.conf
Active: failed (Result: exit-code) since  2023-04-10 08:54:36 MSK; 7h ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 11167 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS --basedir=/usr $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=203/EXEC)
Process: 11156 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
Process: 11154 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Main PID: 11167 (code=exited, status=203/EXEC)

我的操作系统是CentOS Linux release 7.9,我尝试过切换到10.3的源再升级,但也没用。现在我想知道怎么解决这个问题:

  • 要么完成11版本的安装
  • 要么恢复回10.2版本(但官方源已经移除了)
  • 或者删掉11版本的相关包,升级到10.3版本
  • 任何能解决当前问题的方法都行

麻烦大家帮忙看看,不急但需要解决,谢谢!

备注:内容来源于stack exchange,提问作者Intacto

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.22 14:13:02