【问题标题】:Broken mysqld package preventing any other installation in ubuntu损坏的 mysqld 包阻止在 ubuntu 中进行任何其他安装
【发布时间】:2021-09-14 17:03:09
【问题描述】:

我有这个问题很长一段时间了,当我想更改我忘记的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)

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

【问题讨论】:

  • 这不是一个真正的编程问题。您可能会发现在 Ask UbuntuUnix & Linux 上得到更好的答案

标签: mysql ubuntu linux-kernel package-managers dpkg


【解决方案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 systemctlsystemctl --help

【讨论】:

  • 我尝试使用 systemctl disable mysql.service 禁用它,然后尝试安装该软件包,但它仍然给了我相同的响应。
  • 请添加有关您在卸载 mysql-server 时获得的日志的信息。那里应该有信息为什么它无法卸载。卸载后,重新启动,看看你的问题是否解决。有关卸载 MySQL 的更多信息在这里:askubuntu.com/questions/172514/how-do-i-uninstall-mysql
  • 你能解释一下@Luuk 为什么每次安装都会出现它吗?
  • 因为它在 systemd 的配置中,请看systemctl list-unit-files | grep mysql的输出
猜你喜欢
  • 1970-01-01
  • 2012-03-15
  • 1970-01-01
  • 1970-01-01
  • 2012-08-05
  • 1970-01-01
  • 1970-01-01
  • 2011-03-17
  • 2021-09-09
相关资源
最近更新 更多