网站关闭 - MariaDB 失败

网站关闭 - MariaDB 失败

我有一个工作了两年的网站,突然停止工作了。我没有执行任何更新或升级。当我醒来时,我发现它不起作用。

我联系了我的托管提供商,他们告诉我问题不在于他们。然而,他们帮我检查了这个问题并提供了以下答复:

问题是 MySQL 找不到插件“mysql.plugins”表。升级或更新 MariaDB 后,此问题很常见。

我在 Ubuntu 20 上使用 Cyber​​Panel、OpenLiteSpeed 和 MariaDB。OpenLiteSpeed 显示为活动且正在运行,但 MariaDB 显示为失败。

    lshttpd.service - OpenLiteSpeed HTTP Server
     Loaded: loaded (/etc/systemd/system/lshttpd.service; enabled; vendor prese>
     Active: active (running) since Sun 2023-06-25 04:41:05 UTC; 3h 9min ago
    Process: 322602 ExecStart=/usr/local/lsws/bin/lswsctrl start (code=exited, >
   Main PID: 322616 (litespeed)
     CGroup: /system.slice/lshttpd.service
             ├─322616 openlitespeed (lshttpd - main)
             ├─322617 openlitespeed (lscgid)
             ├─322618 openlitespeed (lshttpd - #01)
             ├─322619 openlitespeed (lshttpd - #02)
             ├─322620 openlitespeed (lshttpd - #03)
             ├─322621 openlitespeed (lshttpd - #04)
             ├─354870 lsphp
             └─377408 lsphp

Jun 25 04:41:02 kixia systemd[1]: This usually indicates unclean terminatio>
Jun 25 04:41:02 kixia systemd[1]: lshttpd.service: Found left-over process >
Jun 25 04:41:02 kixia systemd[1]: This usually indicates unclean terminatio>
Jun 25 04:41:02 kixia systemd[1]: lshttpd.service: Found left-over process >
Jun 25 04:41:02 kixia systemd[1]: This usually indicates unclean terminatio>
Jun 25 04:41:02 kixia systemd[1]: Starting OpenLiteSpeed HTTP Server...
Jun 25 04:41:02 kixia lswsctrl[322602]: [OK] Send SIGUSR1 to 310608
Jun 25 04:41:05 kixia systemd[1]: Started OpenLiteSpeed HTTP Server.
 lshttpd.service - OpenLiteSpeed HTTP Server



    v Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2023-06-25 05:08:44 UTC; 3h 7min ago
       Docs: man:mysqld(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 331113 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 331114 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 331116 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl >
    Process: 331166 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
   Main PID: 331166 (code=exited, status=1/FAILURE)
     Status: "MariaDB server is down"

Jun 25 05:08:43 kixia systemd[1]: Starting MariaDB 10.3.38 database server...
Jun 25 05:08:44 kixia systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Jun 25 05:08:44 kixia systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jun 25 05:08:44 kixia systemd[1]: Failed to start MariaDB 10.3.38 database server.

日志档案

2023-06-25  5:08:43 0 [ERROR] InnoDB: Cannot create log files because data files are corrupt or the database was not shut down cleanly after creating the data files.
2023-06-25  5:08:43 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2023-06-25  5:08:43 0 [Note] InnoDB: Starting shutdown...
2023-06-25  5:08:44 0 [ERROR] Plugin 'InnoDB' init function returned error.
2023-06-25  5:08:44 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2023-06-25  5:08:44 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-06-25  5:08:44 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2023-06-25  5:08:44 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2023-06-25  5:08:44 0 [ERROR] Aborting

解决办法是什么?

答案1

DBMS 尝试启动的数据文件已失效。走了。卡普特。

如果你幸运的话,那么你正在从非默认位置(即 /var/lib/mysql 之外)运行 mysqld,并且你现有的配置文件已被覆盖或删除。您只需要修复配置即可。

否则,您需要从备份中恢复。

我没有[备份]

那么你就学到了宝贵的一课。

立即创建备份。

重新安装 Mariadb 可能会起作用。

我正在使用 Cyber​​Panel,

你或许也应该停止这样做。

相关内容