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

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

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.

  1. -bash-# yum -y update
  2. Loaded plugins: fastestmirror
  3. Loading mirror speeds from cached hostfile
  4. Resolving Dependencies
  5. --> Running transaction check
  6. ---> Package MariaDB-server.x86_64 0:10.2.41-1.el7.centos will be updated
  7. ---> Package MariaDB-server.x86_64 0:11.0.1-1.el7.centos will be an update
  8. --> Finished Dependency Resolution
  9. Dependencies Resolved
  10. =============================================================================================================================================================
  11. Package Arch Version Repository Size
  12. =============================================================================================================================================================
  13. Updating:
  14. MariaDB-server x86_64 11.0.1-1.el7.centos mariadb 27 M
  15. Transaction Summary
  16. =============================================================================================================================================================
  17. Upgrade 1 Package
  18. Total download size: 27 M
  19. Downloading packages:
  20. No Presto metadata available for mariadb
  21. MariaDB-server-11.0.1-1.el7.centos.x86_64.rpm | 27 MB 00:02:42
  22. Running transaction check
  23. Running transaction test
  24. Transaction test succeeded
  25. Running transaction
  26. ******************************************************************
  27. A MySQL or MariaDB server package (MariaDB-server-10.2.41-1.el7.centos.x86_64) is installed.
  28. Upgrading directly from MySQL 10.2 to MariaDB 11.0 may not
  29. be safe in all cases. A manual dump and restore using mysqldump is
  30. recommended. It is important to review the MariaDB manual's Upgrading
  31. section for version-specific incompatibilities.
  32. A manual upgrade is required.
  33. - Ensure that you have a complete, working backup of your data and my.cnf
  34. files
  35. - Shut down the MySQL server cleanly
  36. - Remove the existing MySQL packages. Usually this command will
  37. list the packages you should remove:
  38. rpm -qa | grep -i '^mysql-'
  39. You may choose to use 'rpm --nodeps -ev <package-name>' to remove
  40. the package which contains the mysqlclient shared library. The
  41. library will be reinstalled by the MariaDB-shared package.
  42. - Install the new MariaDB packages supplied by MariaDB Foundation
  43. - Ensure that the MariaDB server is started
  44. - Run the 'mysql_upgrade' program
  45. This is a brief description of the upgrade process. Important details
  46. can be found in the MariaDB manual, in the Upgrading section.
  47. ******************************************************************
  48. error: %pre(MariaDB-server-11.0.1-1.el7.centos.x86_64) scriptlet failed, exit status 1
  49. Error in PREIN scriptlet in rpm package MariaDB-server-11.0.1-1.el7.centos.x86_64
  50. MariaDB-server-10.2.41-1.el7.centos.x86_64 was supposed to be removed but is not!
  51. Verifying : MariaDB-server-10.2.41-1.el7.centos.x86_64 1/2
  52. Verifying : MariaDB-server-11.0.1-1.el7.centos.x86_64 2/2
  53. Failed:
  54. MariaDB-server.x86_64 0:10.2.41-1.el7.centos MariaDB-server.x86_64 0:11.0.1-1.el7.centos
  55. Complete!

When I try to remove old 10.2 it shows

  1. -bash-# sudo yum remove MariaDB-server galera
  2. Loaded plugins: fastestmirror
  3. No Match for argument: galera
  4. Resolving Dependencies
  5. --> Running transaction check
  6. ---> Package MariaDB-server.x86_64 0:10.2.41-1.el7.centos will be erased
  7. --> Finished Dependency Resolution
  8. Dependencies Resolved
  9. =============================================================================================================================================================
  10. Package Arch Version Repository Size
  11. =============================================================================================================================================================
  12. Removing:
  13. MariaDB-server x86_64 10.2.41-1.el7.centos @mariadb 117 M
  14. Transaction Summary
  15. =============================================================================================================================================================
  16. Remove 1 Package
  17. Installed size: 117 M
  18. Is this ok [y/N]: y
  19. Downloading packages:
  20. Running transaction check
  21. ERROR with transaction check vs depsolve:
  22. MariaDB-server >= 11.0.0 is needed by (installed) MariaDB-server-compat-11.0.1-1.el7.centos.noarch
  23. ** Found 4 pre-existing rpmdb problem(s), 'yum check' output follows:
  24. 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
  25. 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
  26. MariaDB-server-10.2.41-1.el7.centos.x86_64 has missing requires of galera
  27. MariaDB-server-compat-11.0.1-1.el7.centos.noarch has missing requires of MariaDB-server >= ('0', '11.0.0', None)
  28. Your transaction was saved, rerun it with:
  29. 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:

  1. -bash-# mysql
  2. mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
  3. ERROR 2002 (HY000): Can't connect to local server through socket '/var/lib/mysql/mysql.sock' (2)
  4. -bash-# mysql_upgrade
  5. -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:

  1. -bash-# systemctl status mariadb.service
  2. * mariadb.service - MariaDB 10.2.41 database server
  3. Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  4. Drop-In: /etc/systemd/system/mariadb.service.d
  5. `-migrated-from-my.cnf-settings.conf
  6. Active: failed (Result: exit-code) since 2023-04-10 08:54:36 MSK; 7h ago
  7. Docs: man:mysqld(8)
  8. https://mariadb.com/kb/en/library/systemd/
  9. Process: 11167 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS --basedir=/usr $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=203/EXEC)
  10. 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)
  11. Process: 11154 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  12. 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:

确定