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



在我将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

My OS: CentOS Linux release 7.9

我尝试将marinadb repo更改为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)

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

对不起,我猜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包,如上面的日志所示。

    删除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 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. 启动mariadb 10.2

    systemctl start mariadb

相关内容

  • 没有找到相关文章

最新更新