mysql - InnoDB:试图打开以前打开的表空间

标签 mysql phpmyadmin xampp innodb mediawiki

我这几天一直在解决一个问题。位于我们 Box 帐户上的本地 mediawiki 页面已自行销毁,我们一直在努力使其上线。使用 XAMPP 控制面板 v3.2.1,错误很多,因此我们决定更新 XAMPP (v3.2.2) 并将“htdocs”和“mysql/data”文件移至新数据库。

第一个错误:

    9:50:21 AM  [mysql]     Attempting to start MySQL app...
    9:50:22 AM  [mysql]     Status change detected: running
    9:50:22 AM  [mysql]     Status change detected: stopped
    9:50:22 AM  [mysql]     Error: MySQL shutdown unexpectedly.
    9:50:22 AM  [mysql]     This may be due to a blocked port, missing dependencies, 
    9:50:22 AM  [mysql]     improper privileges, a crash, or a shutdown by another method.
    9:50:22 AM  [mysql]     Press the Logs button to view error logs and check
    9:50:22 AM  [mysql]     the Windows Event Viewer for more clues
    9:50:22 AM  [mysql]     If you need more help, copy and post this
    9:50:22 AM  [mysql]     entire log window on the forums

正如它所说,然后我去日志发现了这个:

    2015-11-20 09:50:22 11f8 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.
    2015-11-20  9:50:22 4600 [Note] InnoDB: Using mutexes to ref count buffer pool pages
    2015-11-20  9:50:22 4600 [Note] InnoDB: The InnoDB memory heap is disabled
    2015-11-20  9:50:22 4600 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
    2015-11-20  9:50:22 4600 [Note] InnoDB: Memory barrier is not used
    2015-11-20  9:50:22 4600 [Note] InnoDB: Compressed tables use zlib 1.2.3
    2015-11-20  9:50:22 4600 [Note] InnoDB: Not using CPU crc32 instructions
    2015-11-20  9:50:22 4600 [Note] InnoDB: Initializing buffer pool, size = 16.0M
    2015-11-20  9:50:22 4600 [Note] InnoDB: Completed initialization of buffer pool
    2015-11-20  9:50:22 4600 [Note] InnoDB: Highest supported file format is Barracuda.
    2015-11-20  9:50:22 4600 [Note] InnoDB: The log sequence numbers 1665234 and 1665234 in ibdata files do not match the log sequence number 50125498 in the ib_logfiles!
    2015-11-20  9:50:22 4600 [Note] InnoDB: Database was not shutdown normally!
    2015-11-20  9:50:22 4600 [Note] InnoDB: Starting crash recovery.
    2015-11-20  9:50:22 4600 [Note] InnoDB: Reading tablespace information from the .ibd files...
    2015-11-20  9:50:22 4600 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace phpmyadmin/pma__tracking uses space ID: 21 at filepath: .\phpmyadmin\pma__tracking.ibd. Cannot open tablespace wiki/archive which uses space ID: 21 at filepath: .\wiki\archive.ibd
    InnoDB: Error: could not open single-table tablespace file .\wiki\archive.ibd
    InnoDB: We do not continue the crash recovery, because the table may become
    InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
    InnoDB: To fix the problem and start mysqld:
    InnoDB: 1) If there is a permission problem in the file and mysqld cannot
    InnoDB: open the file, you should modify the permissions.
    InnoDB: 2) If the table is not needed, or you can restore it from a backup,
    InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
    InnoDB: crash recovery and ignore that table.
    InnoDB: 3) If the file system or the disk is broken, and you cannot remove
    InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
    InnoDB: and force InnoDB to continue crash recovery here.

现在这看起来像是一个标准错误,我在整个网络上看到了许多关于如何修复它的不同建议。我将简要介绍它们。

我尝试的第一件事是遵循日志中的建议。

  1. 没有权限问题
  2. 不清楚我是否需​​要该表,或者是否要摆脱 phpmyadmin/pma__tracking 或 archive.ibd。当我删除archive.ibd 时,错误只是传递到另一个.ibd 文件。
  3. 'innodb_force_recovery=1' 被添加到 my.cnf 中,这会导致一堆错误。

接下来我注意到的是,当我们构建新数据库时,我的 phpMyAdmin (localhost/phpMyAdmin) 中出现了这个错误: phpMyAdmin error

我不确定这是否导致了我所有的问题。我发现人们说要将密码切换为=''。可能会发生此错误,因为我在新数据库中输入旧数据文件夹。我不确定。

网络上的第一个建议是从

中删除以下文件
\mysql\data:
    innodb_index_stats.frm
    innodb_index_stats.ibd 
    innodb_table_stats.frm 
    innodb_table_stats.ibd 
    slave_master_info.ibd 
    slave_relay_log_info.frm 
    slave_relay_log_info.ibd 
    slave_worker_info.frm 
    slave_worker_info.ibd

第二次:

我已尝试删除“ibdata1”

这些都不起作用。

最佳答案

我遇到了同样的问题。我尝试了其他人提出的所有解决方案,但不幸的是没有任何效果。

花了几个小时在 Google 中搜索解决方案后,我终于找到了这个

  1. 打开 my.ini(基于 linux 的系统和 Mac 上的 my.cnf)
  2. 寻找 [mysqld]
  3. 就在 [mysqld] 下方插入 innodb_force_recovery = 1
  4. 启动 MySQL 服务
  5. 停止 MySQL 服务
  6. 从 my.ini 中删除该行 (innodb_force_recovery = 1)
  7. 启动 MySQL 服务

在我的情况下工作完美。

希望这能解决你的问题。

关于mysql - InnoDB:试图打开以前打开的表空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33829888/

相关文章:

mysql - SQL Server 2008,将十进制值转换为百分比而不四舍五入?

php mysql + 创建个人资料页面

database - PhpMyAdmin 导入错误数据库

Python根据网页上的序列号用数据填充sql

mysql - 加载 XML 本地内文件 phpmyadmin 错误 #1064

php - 从 MySQL BLOB 字段中获取 'attachments',并进入文件系统

MySQL 索引 - 最佳实践是什么?

macos - xampp mac os x“此应用程序需要管理员权限”

PHP xampp mail()函数不起作用

php - 如何在非 Wordpress 网站上获取永久链接