mysql - 损坏的 mysqld 包阻止在 ubuntu 中进行任何其他安装

标签 mysql ubuntu linux-kernel package-managers dpkg

我有这个问题很长一段时间了,当我想更改我忘记的mysql密码时,它就开始了。我已经按照很多文档从我的系统中彻底清除了 mysql,这样我就可以为新安装的 mysql 设置一个新密码。但是每次我安装它时,我都会遇到同样的问题,它会询问我相同的旧密码。
目前我已经从我的系统中清除了 mysql,但是即使每当我尝试安装任何东西时,比如说 openssh,我在下载包后都会得到以下日志。

sudo apt-get install openssh-server
.    
.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up mysql-server-8.0 (8.0.23-0ubuntu0.20.04.1) ...
Renaming removed key_buffer and myisam-recover options (if present)
mysqld will log errors to /var/log/mysql/error.log
mysqld is running as pid 9069
Job for mysql.service failed because a timeout was exceeded.
See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/mysql.service.d
             └─override.conf
     Active: activating (auto-restart) (Result: timeout) since Sat 2021-07-03 00:35:37 IST; 5ms ago
    Process: 9257 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
    Process: 9278 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid --skip-grant-tables --skip-networking (code=exited, status=0/SUCCESS)
   Main PID: 9278 (code=exited, status=0/SUCCESS)
     Status: "Server shutdown complete"
      Error: 2 (No such file or directory)

Jul 03 00:35:37 gp-HP-Pavilion-Notebook systemd[1]: mysql.service: Scheduled restart job, restart counter is at 1.
Jul 03 00:35:37 gp-HP-Pavilion-Notebook systemd[1]: Stopped MySQL Community Server.
Jul 03 00:35:37 gp-HP-Pavilion-Notebook systemd[1]: Starting MySQL Community Server...
Jul 03 00:35:41 gp-HP-Pavilion-Notebook systemd[1]: mysql.service: Got notification message from PID 10009, but reception only permitted for main PID 10007
dpkg: error processing package mysql-server-8.0 (--configure):
 installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-8.0; however:
  Package mysql-server-8.0 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          Errors were encountered while processing:
 mysql-server-8.0
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

每次我安装任何东西时,有什么办法可以防止这种情况发生吗?
如果有人可以帮助解决此问题,那就太好了,因为它还会阻止正确安装各种其他软件包。

最佳答案

日志说:有关详细信息,请参阅“systemctl status mysql.service”和“journalctl -xe”。systemctl status mysql.service将显示 mysql.service 的状态。systemctl stop mysql.service将停止 mysql.service。systemctl start mysql.service将启动 mysql.service。systemctl enable mysql.service将在启动时启动 mysql.service。systemctl disable mysql.service将在启动时停止启动 mysql.service。 (我想你需要这个)
更多信息:man systemctl , 和 systemctl --help

关于mysql - 损坏的 mysqld 包阻止在 ubuntu 中进行任何其他安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68230310/

相关文章:

出现 PHP 错误但代码仍然正确执行

linux - 在 Linux 中如何显示文件名为 3 个大写字符的所有文件?

c++ - Ubuntu 上的 argstream.h 库

Linux 过度提交启发式

在内核启动期间检查 ARM 是否处于管理模式或中断模式

mysql - 为什么这个字符串到二进制的转换不起作用?

mysql - 在 mysql 中,如果不为空或另一个表列,是否可以使用表的一列对结​​果进行排序

php - 如何获取主键字段的最后插入值?

python - 如何在 Ubuntu 中运行 Python Qt 文件?

linux-kernel - request_irq() 在内部做什么?