MySQL 更新 10.2 到 11.0 与 yum 问题 (centos 7.9)

问题描述 投票:0回答:1

在我将 Marinadb 的 repo 从 10.2 更改为 11 并启动 yum 更新服务器堆栈时出错,而不是更新/删除 marinadb-server.

-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

如何完成版本 11 的安装 或恢复到 10.2(官方回购已删除) 或删除 11 并更新到 10.3 或任何解决问题的方法。

PS:以下命令不再起作用:

-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

我的操作系统:CentOS Linux 7.9 版

我尝试将 marinadb 存储库更改为 10.3 然后更新,但它不起作用。

当前的mysql状态:

-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)

请帮忙 :) 不着急,但需要解决。

dependencies repository updates yum mariadb-10.2
1个回答
0
投票

抱歉,我想 Stackoverflow 也适用于类似的问题。很高兴知道只应添加与编程相关的问题。

什么帮助我恢复到以前的版本:

  1. 从上面的日志中完全删除 Galera:

    sudo yum 删除 galera-4-26.4.14-1.el7.centos.x86_64

  2. 从存档安装 10.2.41 的实际 galera:

    yum 安装-y https://archive.mariadb.org/yum/10.2.41/centos7-amd64/rpms/galera-25.3.34-1.el7.centos.x86_64.rpm

  3. 通过提供上面日志中显示的完整包名称来删除 MariaDB 11 包。

    sudo yum 删除 MariaDB-server-compat-11.0.1-1.el7.centos.noarch

    sudo yum 删除 MariaDB-common-11.0.1-1.el7.centos.x86_64

    sudo yum 删除 MariaDB-client-11.0.1-1.el7.centos.x86_64

  4. 从存档安装回 10.2

    yum 安装-y https://archive.mariadb.org/yum/10.2.41/centos7-amd64/rpms/MariaDB-server-10.2.41-1.el7.centos.x86_64.rpm

  5. 启动 mariadb 10.2

    systemctl 启动 mariadb

© www.soinside.com 2019 - 2024. All rights reserved.