![无法启动 mysqld](https://linux22.com/image/179035/%E6%97%A0%E6%B3%95%E5%90%AF%E5%8A%A8%20mysqld.png)
我尝试启动 mysql 后得到以下信息:
$ sudo systemctl start mysqld
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
[pi@raspi ~]$ systemctl status mysqld
* mariadb.service - MariaDB 10.5.5 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2020-08-23 08:34:44 PDT; 9s ago
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
Process: 466 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 467 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/S>
Process: 479 ExecStart=/usr/bin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
Main PID: 479 (code=exited, status=1/FAILURE)
Status: "MariaDB server is down"
Aug 23 08:34:44 raspi mariadbd[479]: 2020-08-23 8:34:44 0 [ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.4.14.
Aug 23 08:34:44 raspi mariadbd[479]: 2020-08-23 8:34:44 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
Aug 23 08:34:44 raspi mariadbd[479]: 2020-08-23 8:34:44 0 [Note] InnoDB: Starting shutdown...
Aug 23 08:34:44 raspi mariadbd[479]: 2020-08-23 8:34:44 0 [ERROR] Plugin 'InnoDB' init function returned error.
Aug 23 08:34:44 raspi mariadbd[479]: 2020-08-23 8:34:44 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
Aug 23 08:34:44 raspi mariadbd[479]: 2020-08-23 8:34:44 0 [ERROR] Unknown/unsupported storage engine: InnoDB
Aug 23 08:34:44 raspi mariadbd[479]: 2020-08-23 8:34:44 0 [ERROR] Aborting
Aug 23 08:34:44 raspi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Aug 23 08:34:44 raspi systemd[1]: mariadb.service: Failed with result 'exit-code'.
Aug 23 08:34:44 raspi systemd[1]: Failed to start MariaDB 10.5.5 database server.
lines 1-21/21 (END)
我也没有看到任何syslog-ng
信息/var/log/messages.log
......
我不确定发生了什么事,有人可以帮我解决这个问题吗? :o
正如 @tetech 建议的那样,我应该降级到 mariadb 软件包的先前版本。所以我尝试:
[pi@raspi pkg]$ sudo pacman -U /var/cache/pacman/pkg/mariadb-10.4.14-1-aarch64.pkg.tar.xz
[sudo] password for pi:
loading packages...
warning: downgrading package mariadb (10.5.5-1 => 10.4.14-1)
resolving dependencies...
warning: cannot resolve "mariadb-clients=10.4.14", a dependency of "mariadb"
:: The following package cannot be upgraded due to unresolvable dependencies:
mariadb
:: Do you want to skip the above package for this upgrade? [y/N] n
error: failed to prepare transaction (could not satisfy dependencies)
:: unable to satisfy dependency 'mariadb-clients=10.4.14' required by mariadb
[pi@raspi pkg]$ sudo pacman -U /var/cache/pacman/pkg/mariadb-clients-10.4.14-1-aarch64.pkg.tar.xz
loading packages...
warning: downgrading package mariadb-clients (10.5.5-1 => 10.4.14-1)
resolving dependencies...
warning: cannot resolve "mariadb-libs=10.4.14", a dependency of "mariadb-clients"
:: The following package cannot be upgraded due to unresolvable dependencies:
mariadb-clients
:: Do you want to skip the above package for this upgrade? [y/N]
error: failed to prepare transaction (could not satisfy dependencies)
:: unable to satisfy dependency 'mariadb-libs=10.4.14' required by mariadb-clients
[pi@raspi pkg]$ sudo pacman -U /var/cache/pacman/pkg/mariadb-libs-10.4.14-1-aarch64.pkg.tar.xz
loading packages...
warning: downgrading package mariadb-libs (10.5.5-1 => 10.4.14-1)
resolving dependencies...
looking for conflicting packages...
error: failed to prepare transaction (could not satisfy dependencies)
:: installing mariadb-libs (10.4.14-1) breaks dependency 'mariadb-libs=10.5.5' required by mariadb-clients
[pi@raspi pkg]$ sudo pacman -U /var/cache/pacman/pkg/mariadb-clients-10.4.14-1-aarch64.pkg.tar.xz
loading packages...
warning: downgrading package mariadb-clients (10.5.5-1 => 10.4.14-1)
resolving dependencies...
warning: cannot resolve "mariadb-libs=10.4.14", a dependency of "mariadb-clients"
:: The following package cannot be upgraded due to unresolvable dependencies:
mariadb-clients
:: Do you want to skip the above package for this upgrade? [y/N]
error: failed to prepare transaction (could not satisfy dependencies)
:: unable to satisfy dependency 'mariadb-libs=10.4.14' required by mariadb-clients
但似乎mariadb-libs
是在抱怨mariadb-clients
,反之亦然。我如何降级?我现在想重新初始化我的数据库可能会更容易......
答案1
值得注意的错误是InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.4.14.
看来您没有正确停止数据库然后对其进行升级。
您需要降级到 10.4.14 并进行恢复,或者重新初始化,然后恢复升级之前进行的备份。
答案2
我在 Manjaro Linux 上的解决方案是sudo pacman -s downgrade
运行
downgrade mariadb-libs mariadb-clients mariadb
降级还允许您选择要降级到的版本。超级简单,很有魅力。
答案3
降级mysql服务器的解决方案是:
$ sudo pacman -U /var/cache/pacman/pkg/mariadb-clients-10.4.14-1-aarch64.pkg.tar.xz /var/cache/pacman/pkg/mariadb-libs-10.4.14-1-aarch64.pkg.tar.xz /var/cache/pacman/pkg/mariadb-10.4.14-1-aarch64.pkg.tar.xz
在此之后,我能够再次正常启动我的 MySql 服务器,我现在必须研究如何正确升级它。