MySQL更新10.2至11.0出现yum问题(CentOS 7.9)

huangapple go评论58阅读模式
英文:

MySQL update 10.2 to 11.0 with yum issue (centos 7.9)

问题

切换 MariaDB 仓库版本时,升级到 11.0.1 后遇到错误。尝试以下解决方案:

  • 进行手动升级,备份数据和配置,移除旧版本,安装新版本并运行 mysql_upgrade
  • 或者回滚到 10.2 版本,但官方仓库已移除。可以尝试安装 10.3 版本。
  • 你也尝试过切换到 10.3 仓库,但未成功。

目前 MariaDB 10.2.41 启动失败,需要进一步解决。

英文:

After I changed repo for Marinadb from 10.2 to 11 and launch yum update the server stack on error with not update/remove 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!

When I try to remove old 10.2 it shows

-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

How I can finish installation of version 11
or recover back to 10.2 (official repo removed)
or delete 11 and update to 10.3
or anything to resolve problem.

PS: Following commands do not work anymore:

-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

My OS: CentOS Linux release 7.9

I tried to change marinadb repo to 10.3 and then update but it does not work.

current mysql status:

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

Help please MySQL更新10.2至11.0出现yum问题(CentOS 7.9) No rush but need to resolve.

答案1

得分: 0

抱歉,我猜想 Stackoverflow 对类似问题也起到了作用。很高兴知道只应添加与编程相关的问题。

帮助我恢复到以前版本的方法:

  1. 从上面的日志中删除 Galera 的确切版本:

    sudo yum remove galera-4-26.4.14-1.el7.centos.x86_64

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

    yum install -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 remove MariaDB-server-compat-11.0.1-1.el7.centos.noarch

    sudo yum remove MariaDB-common-11.0.1-1.el7.centos.x86_64

    sudo yum remove MariaDB-client-11.0.1-1.el7.centos.x86_64

  4. 从存档中重新安装 10.2 版:

    yum install -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 start mariadb

英文:

Sorry, I guess Stackoverflow works for similar the issues as well. Good to know that only programming related question should be added.

What helps for me to recover back previous version:

  1. Remove Galera exact from the logs above:

    sudo yum remove galera-4-26.4.14-1.el7.centos.x86_64

  2. Install actual galera for 10.2.41 from archive:

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

  3. remove MariaDB 11 packages by provide full package names as shows on logs above.

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

    sudo yum remove MariaDB-common-11.0.1-1.el7.centos.x86_64

    sudo yum remove MariaDB-client-11.0.1-1.el7.centos.x86_64

  4. Install back 10.2 from archive

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

  5. Launch mariadb 10.2

    systemctl start mariadb

huangapple
  • 本文由 发表于 2023年4月10日 23:14:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/75978311.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定