InnoDB:尝试打开以前打开的表空间

ded*_*ead 39 mysql xampp mediawiki innodb phpmyadmin

我一直在研究一个问题几天了.我们的本地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
Run Code Online (Sandbox Code Playgroud)

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

    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.
Run Code Online (Sandbox Code Playgroud)

现在这看起来像一个标准错误,我在网上看到了很多不同的建议如何解决它.我将简要介绍一下.

我尝试的第一件事是按照日志中的建议.

  1. 没有许可问题
  2. 目前尚不清楚我是否需​​要该表,或者是否要摆脱phpmyadmin/pma__tracking或archive.ibd.当我摆脱archive.ibd时,错误刚刚过去到另一个.ibd文件.
  3. 'innodb_force_recovery = 1'被添加到my.cnf,这会导致一堆错误.

我注意到的下一件事是,当我们构建新数据库时,我在phpMyAdmin(localhost/phpMyAdmin)中收到此错误: phpMyAdmin错误

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

网络上的第一个建议是从中删除以下文件

\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
Run Code Online (Sandbox Code Playgroud)

第二名:

我试过删除'ibdata1'

这些都没有奏效.

Nes*_*sar 188

我有同样的问题.我尝试了其他人提出的所有解决方案,但遗憾的是没有任何效果.

花了几个小时在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服务

在我的案例中工作得很完美.

我希望这能解决你的问题.

  • 这是太棒了!像魅力一样工作,无需删除所有内容并重新安装. (10认同)
  • 如果你在MAMP上找不到`my.cnf`(在Mac上),这很有用:http://stackoverflow.com/a/2869707/1131990基本上,在`/ Applications/MAMP创建一个`my.cnf`文件/ conf /`,添加一个`[mysqld]`部分,添加`innodb_force_recovery = 1` (10认同)
  • 好吧,MAMP Pro每次启动都会重写.cnf文件,所以你必须从File-> Edit Template-> MySQL编辑模板 (7认同)
  • 不要试图通过在Spotlight上找到直接编辑my.cnf,你将到达/tmp/my.cnf而不是真实的.您必须通过MAMP Pro App直接修改(文件>编辑>模板> MySQL) (7认同)
  • 我喜欢这个网站.大约4年前提出的一个问题现在帮助了我,花了2分钟.这个答案需要一个该死的复选标记. (3认同)
  • *堆栈溢出*,每一个血腥的答案都让开发者无所适从。发现! (2认同)
  • 谢谢@Nesar,你救了我的一天 (2认同)

San*_*San 6

我得到了同样的错误.这些是我遵循的步骤.

  1. 获得\ xampp\mysql\data的备份

  2. 从数据文件夹中删除了所有文件和文件夹,除了 mysql

  3. 退出并再次启动XAMPP.

  4. data逐个从文件夹中移动数据库.


小智 5

尝试重命名/Applications/XAMPP/xamppfiles/var/mysql/ib_logfile0/Applications/XAMPP/xamppfiles/var/mysql/ib_logfile0.bkp

/Applications/XAMPP/xamppfiles/var/mysql/ib_logfile1/Applications/XAMPP/xamppfiles/var/mysql/ib_logfile1.bkp


Nem*_*emo 0

Tgr 的回答看起来很合适。关于权限等的消息是通用的;实际的错误消息是

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
Run Code Online (Sandbox Code Playgroud)

您的 wiki 数据库和 phpmyadmin 数据库不知何故最终具有相同的表空间 ID。如果对方不在场,双方都会正常工作;就像现在一样,您必须以某种方式对其中之一重新编号。