如何解决“错误:MySQL 意外关闭”?无法在 XAMPP 上运行

问题描述 投票:0回答:3

当尝试启动 XAMPP 时,我得到以下信息:

[mysql]     Error: MySQL shutdown unexpectedly.
11:02:20  [mysql]   This may be due to a blocked port, missing dependencies, 
11:02:20  [mysql]   improper privileges, a crash, or a shutdown by another method.
11:02:20  [mysql]   Press the Logs button to view error logs and check
11:02:20  [mysql]   the Windows Event Viewer for more clues
11:02:20  [mysql]   If you need more help, copy and post this
11:02:20  [mysql]   entire log window on the forums

日志副本:

2022-09-15 11:02:19 0 [Note] InnoDB: Uses event mutexes
2022-09-15 11:02:19 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-09-15 11:02:19 0 [Note] InnoDB: Number of pools: 1
2022-09-15 11:02:19 0 [Note] InnoDB: Using SSE2 crc32 instructions
2022-09-15 11:02:19 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2022-09-15 11:02:19 0 [Note] InnoDB: Completed initialization of buffer pool
2022-09-15 11:02:19 0 [ERROR] InnoDB: Missing MLOG_CHECKPOINT at 41802377 between the checkpoint 41802377 and the end 41802240.
2022-09-15 11:02:19 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2022-09-15 11:02:20 0 [Note] InnoDB: Starting shutdown...
2022-09-15 11:02:20 0 [ERROR] Plugin 'InnoDB' init function returned error.
2022-09-15 11:02:20 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2022-09-15 11:02:20 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-09-15 11:02:20 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2022-09-15 11:02:20 0 [ERROR] Aborting

PHP-我的管理错误:

 mysqli::real_connect(): (HY000/2002): No connection could be made because the target machine actively refused it

 Connection for controluser as defined in your configuration failed.
 mysqli::real_connect(): (HY000/2002): No connection could be made because the target machine actively refused it

 phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

有人可以帮我解决吗?

mysql database xampp
3个回答
9
投票
  1. 进入xampp/mysql目录
  2. 将 /data 文件夹重命名为 /data_old
  3. 复制 /backup 文件夹并粘贴到此处
  4. 将 /backup_copy 文件夹重命名为 /data
  5. 转到 /data_old 文件夹并复制所有数据库文件夹(除了 phpmyadmin、mysql、performance_schema)
  6. 转到 /data 文件夹并粘贴从 /data_old 复制的所有数据库文件夹
  7. 再次进入 /data_old 文件夹并复制 ibdata1 文件
  8. 再次转到 /data 文件夹并将 ibdata1 文件粘贴到此处
  9. 再次重新启动服务器。

1
投票
  1. 前往xampp
  2. 然后是Mysql目录
  3. data 文件夹重命名为其他名称,例如 data_old
  4. 复制backup文件夹并用data
  5. 重命名该文件夹
  6. 将数据库从旧数据文件夹复制到新数据文件夹
  7. 将日志文件 ibdata1 && ib_logfileXX 从旧文件夹复制到新数据文件夹。
  8. 重新启动 MySQL 服务器。

就是这样!


0
投票

我认为最干净的解决方案是 Vel 在对该问题的评论中提出的解决方案。您还可以重命名文件而不是删除它们。

删除这些文件并重新启动 rm /var/lib/mysql/ib_logfile0 rm /var/lib/mysql/ib_logfile1 –

在 XAMPP 中,这些文件位于:\xampp\mysql\data。就我而言,C:\xampp\mysql\data\ib_logfile0 和 C:\xampp\mysql\data\ib_logfile1

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