XAMPP/MySQL:重启 MySQL 后无法打开单表表空间文件 .mysqlinnodb_index_stats.ibd

2022-01-14 00:00:00 database xampp php mysql drupal

我已经在我的本地 XAMPP 服务器上安装了 Drupal.一切正常,在我重新启动 XAMPP 之前,包含和使用数据库/站点没有问题.从那时起,我在日志文件中得到以下信息:

I've installed Drupal on my local XAMPP Server. It worked all fine, no problems with including and working with the database/site till i restarted XAMPP. Since then I get the following at my logfile:

2013-09-02 16:18:46 2544 [注意] 插件FEDERATED"已禁用.

2013-09-02 16:18:46 2544 [Note] Plugin 'FEDERATED' is disabled.

2013-09-02 16:18:46 3e8 InnoDB:警告:已弃用 innodb_additional_mem_pool_size.这个选项可能会在未来的版本中被删除,连同选项 innodb_use_sys_malloc 和 InnoDB 的内部内存分配器.

2013-09-02 16:18:46 3e8 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.

2013-09-02 16:18:46 2544 [注意] InnoDB:InnoDB 内存堆已禁用

2013-09-02 16:18:46 2544 [Note] InnoDB: The InnoDB memory heap is disabled

2013-09-02 16:18:46 2544 [注意] InnoDB:互斥锁和 rw_locks 使用 Windows 互锁函数

2013-09-02 16:18:46 2544 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions

2013-09-02 16:18:46 2544 [注意] InnoDB:压缩表使用 zlib 1.2.3

2013-09-02 16:18:46 2544 [Note] InnoDB: Compressed tables use zlib 1.2.3

2013-09-02 16:18:46 2544 [注意] InnoDB:不使用 CPU crc32 指令

2013-09-02 16:18:46 2544 [Note] InnoDB: Not using CPU crc32 instructions

2013-09-02 16:18:46 2544 [注意] InnoDB:初始化缓冲池,大小 = 16.0M

2013-09-02 16:18:46 2544 [Note] InnoDB: Initializing buffer pool, size = 16.0M

2013-09-02 16:18:46 2544 [注意] InnoDB: 缓冲池初始化完成

2013-09-02 16:18:46 2544 [Note] InnoDB: Completed initialization of buffer pool

2013-09-02 16:18:46 2544 [注意] InnoDB:支持的最高文件格式是梭子鱼.

2013-09-02 16:18:46 2544 [Note] InnoDB: Highest supported file format is Barracuda.

2013-09-02 16:18:47 2544 [注意] InnoDB:ibdata 文件中的日志序列号 1600614 和 1600614 与 ib_logfiles 中的日志序列号 1600644 不匹配!

2013-09-02 16:18:47 2544 [Note] InnoDB: The log sequence numbers 1600614 and 1600614 in ibdata files do not match the log sequence number 1600644 in the ib_logfiles!

2013-09-02 16:18:47 2544 [注意] InnoDB:数据库未正常关闭!

2013-09-02 16:18:47 2544 [Note] InnoDB: Database was not shutdown normally!

2013-09-02 16:18:47 2544 [注意] InnoDB:开始崩溃恢复.

2013-09-02 16:18:47 2544 [Note] InnoDB: Starting crash recovery.

2013-09-02 16:18:47 2544 [注意] InnoDB:从 .ibd 文件中读取表空间信息...

2013-09-02 16:18:47 2544 [Note] InnoDB: Reading tablespace information from the .ibd files...

2013-09-02 16:18:47 2544 [错误] InnoDB:试图打开以前打开的表空间.以前的表空间 drupal/variable 在文件路径:.drupalvariable.ibd 处使用空间 ID:2.无法打开使用空间 ID 的表空间 mysql/innodb_index_stats:2 在文件路径:.mysqlinnodb_index_stats.ibd

2013-09-02 16:18:47 2544 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace drupal/variable uses space ID: 2 at filepath: .drupalvariable.ibd. Cannot open tablespace mysql/innodb_index_stats which uses space ID: 2 at filepath: .mysqlinnodb_index_stats.ibd

InnoDB:错误:无法打开单表表空间文件 .mysqlinnodb_index_stats.ibd

InnoDB: Error: could not open single-table tablespace file .mysqlinnodb_index_stats.ibd

InnoDB:我们不继续崩溃恢复,因为表可能会变成

InnoDB: We do not continue the crash recovery, because the table may become

InnoDB:如果我们无法将 InnoDB 日志中的日志记录应用到它,则会损坏.

InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.

InnoDB:修复问题并启动 mysqld:

InnoDB: To fix the problem and start mysqld:

InnoDB:1)如果文件有权限问题,mysqld不能

InnoDB: 1) If there is a permission problem in the file and mysqld cannot

InnoDB:打开文件,你应该修改权限.

InnoDB: open the file, you should modify the permissions.

InnoDB: 2) 如果不需要该表,或者您可以从备份中恢复它,

InnoDB: 2) If the table is not needed, or you can restore it from a backup,

InnoDB:然后你可以删除.ibd文件,InnoDB会做一个正常的

InnoDB: then you can remove the .ibd file, and InnoDB will do a normal

InnoDB:崩溃恢复并忽略该表.

InnoDB: crash recovery and ignore that table.

InnoDB: 3) 如果文件系统或磁盘损坏,无法删除

InnoDB: 3) If the file system or the disk is broken, and you cannot remove

InnoDB:.ibd文件,可以设置innodb_force_recovery >my.cnf 中的 0

InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf

InnoDB:并强制 InnoDB 在此处继续崩溃恢复.

InnoDB: and force InnoDB to continue crash recovery here.

我通过谷歌寻找解决方案,但这似乎只是 drupal 数据库的问题,因为如果我删除数据库,它可以连接 MySQL.

I looked for a solution via google but it seems to be a problem just with the drupal database because it's able to connect with MySQL if I remove the database.

我希望有人可以帮助我:(.

I hope someone could help me :(.

推荐答案

dev_khan,尝试在启用 innodb_force_recovery 选项的情况下以只读模式重新启动 MySQL:

dev_khan, try restarting MySQL in Read-Only mode with the innodb_force_recovery option enabled:

  1. 编辑 my.cnf - 找到以下行:# innodb_force_recovery = 2
  2. 注释中的行(删除#)
  3. 重启 MySQL,让 MySQL 引擎自行修复.
  4. 再次注释 innodb_force_recovery 行(添加 #)
  5. 再次重新启动 MySQL,您将再次获得完全访问权限,而没有只读限制.

来自德国的问候

相关文章