Ubuntu 20.04-无法更新 mysql-client 和 mysql-server 软件包

Ubuntu 20.04-无法更新 mysql-client 和 mysql-server 软件包

在从 18.04 更新到 Ubuntu 20.04 之前,我决定先将 MySQL 从 5.5 更新到 8.0。

然后我更新到了 Ubuntu 20.04,一切正常,直到 mysql-client 和 mysql-server 的一些更新发布。两者都无法安装。

apt-get 升级返回:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  mysql-client mysql-server
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

然后我输入apt-get 安装 mysql 客户端并收到:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mysql-client : Depends: mysql-client-8.0 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

但是 mysql-client-8.0 已安装(更新:哎呀,实际上并没有安装):

apt 策略 mysql-client-8.0

mysql-client-8.0:
  Installed: (none)
  Candidate: 8.0.29-0ubuntu0.20.04.3
  Version table:
     8.0.29-0ubuntu0.20.04.3 500
        500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
     8.0.29-0ubuntu0.20.04.2 500
        500 http://ubuntu.mirrors.ovh.net/ubuntu focal-updates/main amd64 Packages
     8.0.19-0ubuntu5 500
        500 http://ubuntu.mirrors.ovh.net/ubuntu focal/main amd64 Packages

在那之后....

apt-get 安装 mysql-client-8.0

Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mysql-client-8.0 : Depends: mysql-common (>= 5.5)
E: Unable to correct problems, you have held broken packages.

最后尝试了...

apt-get 安装 mysql-commmon

Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-common is already the newest version (8.0.28-1ubuntu18.04).
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

apt-cache 策略 mysql-common

mysql-common:
  Installed: 8.0.28-1ubuntu18.04
  Candidate: 8.0.28-1ubuntu18.04
  Version table:
 *** 8.0.28-1ubuntu18.04 100
        100 /var/lib/dpkg/status
     5.8+1.0.5ubuntu2 500
        500 http://ubuntu.mirrors.ovh.net/ubuntu focal/main amd64 Packages

我在网上看到有人遇到过类似但并不完全相同的问题...不太确定如何修复此问题而不造成重大问题。我在这个服务器上运行一个网站,不想造成无法挽回的损害,但确实想修复此问题。

谢谢!

已解决: apt 删除 mysql-common 然后 apt 安装 mysql-server

答案1

我遇到了完全相同的问题。一旦服务器更新到 8.0.29-0ubuntu0.20.04.3,MySQL 就不再工作了。我无法启动它。它进入无限循环尝试运行更新过程。

如果我运行,top我会得到以下信息:

2395 mysql     20   0   27.3g   2.3g  23164 S 100.0   7.2   3:27.15 mysqld 

它以 100% 的 CPU 运行。

在 mysql 错误日志中我将其冻结在:

2022-05-05T16:29:47.691578Z 4 [System] [MY-013381] [Server] Server upgrade from '80028' to '80029' started.
2022-05-05T16:34:12.394803Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2022-05-05T16:34:12.395761Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.29-0ubuntu0.20.04.3) starting as process 2393
2022-05-05T16:34:12.418552Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-05-05T16:34:13.414340Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-05-05T16:34:13.848163Z 4 [System] [MY-013381] [Server] Server upgrade from '80028' to '80029' started.

答案2

我遇到了同样的问题。对我来说,这是因为我有max_binlog_size = 100Mmysqld.cnf,并且已达到大小限制。我删除了 /var/lin/mysql 中的所有 binlog 文件并清空了 binlog.index 文件,mysql 启动时没有问题。

相关内容