MYSQL 未在 xampp 上启动

问题描述 投票:0回答:4
Error:MySQL shutdown unexpectedly.
This may be due to a blocked port, missing dependencies, improper privileges, a crash, or a shutdown by another method.
Press the Logs button to view error logs and check the Windows Event Viewer for more clues If you need more help, copy and post this entire log window on the forums.

我该如何解决这个问题?

php
4个回答
0
投票

也许

Skype
已占用您的
xampp
端口。尝试结束 Skype 或任何其他从任务管理器占用该端口的应用程序。


0
投票

我最近遇到了这个问题。

如果您安装了

SQL Server Management Studio
,请尝试停止该服务:

SQL Server Reporting Services

我理解您可能会遇到这种情况的原因有很多;这是我的解决方案。


0
投票

尝试更改端口,也许另一个应用程序(Skype)占用了它。或者尝试重新安装 xampp 软件包。它几乎总是有效。


0
投票

我最近遇到了这个错误。经过几个小时的努力后,我发现按照 XAMPP 控制面板输出的建议检查我的错误日志。

如何阅读错误日志

在 XAMPP 控制面板中导航

MySql row >> 'Logs' btn >> click on 'mysql_error.log'

  1. 如果是新遇到的错误(对于新的 XAMPP 安装),错误日志将很小且易于阅读,但如果您已经使用 XAMPP 一段时间,则错误日志将是更长、更复杂的文本文件。
  2. 尝试找到与您的操作相关的时间戳。

通常是一个以如下语句开头的记录状态:

2024-10-12 0:47:09 0 [注意]启动MariaDB 10.4.32-MariaDB源版本.................

& 结尾如下(如果仅发生错误):

2024-10-12 0:47:09 0 [错误] 正在中止

  1. 如果可能有记录状态并且您觉得它太复杂而难以阅读,只需导航到 XAMPP 安装的
    'mysql' directory >> 'data' directory >> locate 'mysql_error.log'
    文本文档文件并将其删除。 (重新启动 XAMPP 并重新评估步骤将自动创建一个新的
    'mysql_error.log'
    文件。新文件将仅包含单个记录状态,并且阅读起来会更容易/更适合初学者)

识别错误

错误状态将显示为:

[ERROR]
&常规记录状态将显示为:
[Note]

  1. 找到
    [ERROR]
    陈述并仔细阅读。

我的 MySQL 错误:

MySQL shutdown unexpectedly
我收到以下错误日志:

2024-10-12  0:47:09 0 [Note] Starting MariaDB 10.4.32-MariaDB source revision c4143f909528e3fab0677a28631d10389354c491 as process 16560
Cannot find checkpoint record at LSN (1,0x5792)
2024-10-12  0:47:09 0 [ERROR] mysqld.exe: Aria recovery failed. Please run aria_chk -r on all Aria tables and delete all aria_log.######## files
2024-10-12  0:47:09 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2024-10-12  0:47:09 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2024-10-12  0:47:09 0 [Note] InnoDB: Uses event mutexes
...............................
...............................
...............................
2024-10-12  0:47:09 0 [Note] InnoDB: Buffer pool(s) load completed at 241012  0:47:09
2024-10-12  0:47:09 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2024-10-12  0:47:09 0 [ERROR] Failed to initialize plugins.
2024-10-12  0:47:09 0 [ERROR] Aborting

这主要表明错误:

Aria recovery failed
这是由于

  • XAMPP 关闭不当
  • 或写入权限下降(使用 MS Windows 环境)
  • 或 MariaDB 表损坏

修复错误

  1. 关闭 XAMPP 中所有正在运行的服务并重新启动
  2. 导航至
    'XAMPP' installation directory >> 'mysql' directory >> 'data' directory >> 'mysql' directory (there is another sub directory within the location)
  3. 右键单击空白处并打开终端
  4. 复制粘贴或输入建议的命令:

aria_chk -r

  1. 向后导航一个目录
  2. 找到
    aria_log.00000001
    文件或类似
    aria_log.0000000x
    格式的文件并按照建议将其删除。

如果错误是由于“写入权限下降”(这是我在 Windows 11 系统中的情况,XAMPP 未安装在 Windows 安装驱动器 -> C 中) |否则跳过步骤 7,8 和 9:

  1. 导航到 XAMPP 的根目录

  2. 打开

    properties
    文件
    xampp-control.ini

  3. 导航到“安全”选项卡,

    9.i.在“组或用户名”中,选择

    Everyone
    并单击“编辑”btn

    9.ii.在“权限”中检查“写入”权限(然后“应用”和“确定”保存)

  4. 使用“exit”正确退出 XAMPP 控制面板。


全新启动 XAMPP 并启动 MySQL 将正常工作,不会出现任何错误...

如果 XAMPP 仍然抛出 MySQL 错误:

MySQL shutdown unexpectedly

  • 重做该过程
  • 在第6步之后,另外删除
    aria_log_control
    (位于
    aria_log.0000000x
    之后)文件(相关文件将自动重新创建)

[如有必要,请改进此答案]

© www.soinside.com 2019 - 2024. All rights reserved.