表不在引擎中 - InnoDB/MySQL

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

今天我遇到了一个问题,无论如何 XAMPP MariaDB 都无法启动。 日志看起来像这样:

2024-01-29 13:14:05 0 [Note] Starting MariaDB 10.4.28-MariaDB source revision c8f2e9a5c0ac5905f28b050b7df5a9ffd914b7e7 as process 5912
2024-01-29 13:14:05 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2024-01-29 13:14:05 0 [Note] InnoDB: Uses event mutexes
2024-01-29 13:14:05 0 [Note] InnoDB: Compressed tables use zlib 1.2.12
2024-01-29 13:14:05 0 [Note] InnoDB: Number of pools: 1
2024-01-29 13:14:05 0 [Note] InnoDB: Using SSE2 crc32 instructions
2024-01-29 13:14:05 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2024-01-29 13:14:05 0 [Note] InnoDB: Completed initialization of buffer pool
2024-01-29 13:14:06 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2024-01-29 13:14:06 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2024-01-29 13:14:06 0 [Note] InnoDB: Setting file 'C:\Xamp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2024-01-29 13:14:06 0 [Note] InnoDB: File 'C:\Xamp\mysql\data\ibtmp1' size is now 12 MB.
2024-01-29 13:14:06 0 [Note] InnoDB: Waiting for purge to start
2024-01-29 13:14:06 0 [Note] InnoDB: 10.4.28 started; log sequence number 2358558; transaction id 10636
2024-01-29 13:14:06 0 [Note] InnoDB: Loading buffer pool(s) from C:\Xamp\mysql\data\ib_buffer_pool
2024-01-29 13:14:06 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-01-29 13:14:06 0 [Note] Server socket created on IP: '::'

所以我尝试了以下解决方案:https://stackoverflow.com/a/63623364/22477932

现在我的数据库再次启动,但是我的所有表“引擎中不存在”。根据修复的一些答案,不应该有任何数据丢失。

我相信这与日志文件有关,但我不知道也找不到太多关于如何“恢复”它们的信息。

欢迎任何有关此问题的帮助。我的数据文件夹中仍然有这些文件。

对于感兴趣的人来说,日志现在看起来是这样的:

2024-01-29 13:23:27 0 [Note] Starting MariaDB 10.4.28-MariaDB source revision c8f2e9a5c0ac5905f28b050b7df5a9ffd914b7e7 as process 6336
2024-01-29 13:23:27 0 [Note] InnoDB: The first innodb_system data file 'ibdata1' did not exist. A new tablespace will be created!
2024-01-29 13:23:27 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2024-01-29 13:23:27 0 [Note] InnoDB: Uses event mutexes
2024-01-29 13:23:27 0 [Note] InnoDB: Compressed tables use zlib 1.2.12
2024-01-29 13:23:27 0 [Note] InnoDB: Number of pools: 1
2024-01-29 13:23:27 0 [Note] InnoDB: Using SSE2 crc32 instructions
2024-01-29 13:23:27 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2024-01-29 13:23:27 0 [Note] InnoDB: Completed initialization of buffer pool
2024-01-29 13:23:27 0 [Note] InnoDB: Setting file 'C:\Xamp\mysql\data\ibdata1' size to 10 MB. Physically writing the file full; Please wait ...
2024-01-29 13:23:27 0 [Note] InnoDB: File 'C:\Xamp\mysql\data\ibdata1' size is now 10 MB.
2024-01-29 13:23:27 0 [Note] InnoDB: Setting log file C:\Xamp\mysql\data\ib_logfile101 size to 5242880 bytes
2024-01-29 13:23:27 0 [Note] InnoDB: Setting log file C:\Xamp\mysql\data\ib_logfile1 size to 5242880 bytes
2024-01-29 13:23:27 0 [Note] InnoDB: Renaming log file C:\Xamp\mysql\data\ib_logfile101 to C:\Xamp\mysql\data\ib_logfile0
2024-01-29 13:23:27 0 [Note] InnoDB: New log files created, LSN=11451
2024-01-29 13:23:27 0 [Note] InnoDB: Doublewrite buffer not found: creating new
2024-01-29 13:23:27 0 [Note] InnoDB: Doublewrite buffer created
2024-01-29 13:23:27 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2024-01-29 13:23:27 0 [Note] InnoDB: Creating foreign key constraint system tables.
2024-01-29 13:23:27 0 [Note] InnoDB: Creating tablespace and datafile system tables.
2024-01-29 13:23:27 0 [Note] InnoDB: Creating sys_virtual system tables.
2024-01-29 13:23:27 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2024-01-29 13:23:27 0 [Note] InnoDB: Setting file 'C:\Xamp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2024-01-29 13:23:27 0 [Note] InnoDB: File 'C:\Xamp\mysql\data\ibtmp1' size is now 12 MB.
2024-01-29 13:23:27 0 [Note] InnoDB: Waiting for purge to start
2024-01-29 13:23:28 0 [Note] InnoDB: 10.4.28 started; log sequence number 0; transaction id 7
2024-01-29 13:23:28 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-01-29 13:23:28 0 [Note] Zerofilling moved table:  '.\mysql\plugin'
2024-01-29 13:23:28 0 [Note] Zerofilling moved table:  '.\mysql\servers'
2024-01-29 13:23:28 0 [Note] Server socket created on IP: '::'.
mysql mariadb xampp innodb data-loss
1个回答
0
投票

如果数据文件夹内有数据文件,则可能有机会恢复您的数据。请按照以下步骤操作:

1。备份: 在尝试任何恢复之前创建当前状态的备份。

2。检查数据文件: 确认您的数据文件仍然存在于 C:\Xamp\mysql\data 文件夹中。查找 .frm 文件(表定义文件)和 .ibd 文件(InnoDB 数据文件)。

3. ibdata 文件: InnoDB 使用共享表空间,通常存储在 ibdata 文件中。确保这些文件也存在。

4。检查表定义: 确认表的 .frm 文件存在。这些文件包含表结构。如果它们丢失,您的表可能无法恢复。

5。检查 InnoDB 日志文件: InnoDB 维护对于崩溃恢复至关重要的日志文件。这些文件通常命名为 ib_logfile0 和 ib_logfile1。确认它们存在于 MySQL 数据目录中。

6。 InnoDB 恢复: 如果您有 InnoDB 日志文件,则可以尝试 InnoDB 恢复。在 my.cnf 或 my.ini 文件中,确保 innodb_force_recovery 选项未设置或设置为最低值 (0)。如果设置为较高的值,InnoDB 可能无法正确启动。

7。手动恢复: 如果上述步骤不起作用,您可能需要手动重新创建表并导入数据。使用.frm文件重新创建表结构,然后从.ibd文件导入数据。

希望您能找到有用的信息,并希望您能以任何方式解决您的问题:)。

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