mariadb debian 更新损坏

mariadb debian 更新损坏

我有带反向移植的 Debian 8.0,并且设置了官方的 mariadb 存储库。我已经有了 mariadb-server-10.1,它正在尝试升级到其他版本。mariadb 升级失败,现在它坏了。我不能再使用 owncloud 了。使用 mysql 的另一个服务是 wordpress,但它运行正常。

当我想升级 mariadb 时,我收到此消息:

Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mariadb-server-10.1 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mariadb-server:
 mariadb-server depends on mariadb-server-10.1 (= 10.1.22+maria-1~jessie); however:
  Package mariadb-server-10.1 is not configured yet.

dpkg: error processing package mariadb-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mariadb-server-10.1
 mariadb-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

systemctl status mariadb.service给出:

Apr 22 14:01:56 ctl mysqld[10359]: 2017-04-22 14:01:56 139845057845504 [ERROR] mysqld: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/var/lib/mysql/aria_log_control'
Apr 22 14:01:56 ctl mysqld[10359]: 2017-04-22 14:01:56 139845057845504 [ERROR] Plugin 'Aria' init function returned error.
Apr 22 14:01:56 ctl mysqld[10359]: 2017-04-22 14:01:56 139845057845504 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
Apr 22 14:01:56 ctl mysqld[10359]: 2017-04-22 14:01:56 139845057845504 [Note] Plugin 'FEEDBACK' is disabled.
Apr 22 14:01:56 ctl mysqld[10359]: 2017-04-22 14:01:56 139845057845504 [ERROR] Unknown/unsupported storage engine: InnoDB
Apr 22 14:01:56 ctl mysqld[10359]: 2017-04-22 14:01:56 139845057845504 [ERROR] Aborting
Apr 22 14:01:57 ctl systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Apr 22 14:01:57 ctl systemd[1]: Failed to start MariaDB database server.
Apr 22 14:01:57 ctl systemd[1]: mariadb.service: Unit entered failed state.
Apr 22 14:01:57 ctl systemd[1]: mariadb.service: Failed with result 'exit-code'.

给出journalctl -xe

Apr 22 15:05:25 ctl sshd[10944]: Received disconnect from 61.177.172.60: 11:  [preauth]
Apr 22 15:05:25 ctl sshd[10944]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=61.177.172.60  user=root
Apr 22 15:06:12 ctl sshd[10946]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=61.177.172.60  user
Apr 22 15:06:14 ctl sshd[10946]: Failed password for root from 61.177.172.60 port 51871 ssh2
Apr 22 15:06:17 ctl sshd[10946]: Failed password for root from 61.177.172.60 port 51871 ssh2
Apr 22 15:06:20 ctl sshd[10946]: Failed password for root from 61.177.172.60 port 51871 ssh2
Apr 22 15:06:21 ctl sshd[10946]: Received disconnect from 61.177.172.60: 11:  [preauth]

ps aux | grep mysql 的输出为:

tchokap+ 11212 0.0 0.0 12728 2208 pts/0 S+ 15:31 0:00 
grep mysql root 16860 0.0 0.0 40540 3196 ? S Feb01 0:00 
sudo mysqld --binlog_format=MIXED mysql 16861 0.0 8.2 1064928 333048 ? Sl Feb01 103:34 
mysqld --binlog_format=MIXED

我认为日志 ctl 指的是我的服务器无法解析主机 ctl 的另一个问题。

答案1

看起来您出于某种原因sudo mysqld --binlog_format=MIXED在 2 月 1 日使用命令手动启动了 mariadb。

直接调用 mysqld 而不是通过 init 系统(在本例中为 systemd)启动它是导致现在情况奇怪的原因。

升级过程假定它可以要求 init 系统停止 mariadb,然后进行升级,但是您有一个mysqldinit 系统一无所知的实例。

mysqld这就是尽管状态为“关闭”但仍在运行的原因。

您应该确保您在命令行上提供的设置binlog_format=MIXED在配置文件中my.cnf,停止手动启动mysqld,然后重试。

答案2

在我的例子中,mysqld_safe每次我终止 mysqld 进程时它都会重新启动。

做一个ps aux | grep mysqld

获取每个进程的 PID(第二列)

为每个进程运行一个kill -s 9 PID(您可以写多个 PID,并用空格分隔它们。

之后,尝试再次运行apt-get upgradeapt-get dist-upgrade

相关内容