XAMPP/MySQL: could not open single-table tablespac

2019-03-14 23:56发布

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 [Note] Plugin 'FEDERATED' is disabled.

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 [Note] InnoDB: The InnoDB memory heap is disabled

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

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

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

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

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

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

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 [Note] InnoDB: Database was not shutdown normally!

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

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

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: .\drupal\variable.ibd. Cannot open tablespace mysql/innodb_index_stats which uses space ID: 2 at filepath: .\mysql\innodb_index_stats.ibd

InnoDB: Error: could not open single-table tablespace file .\mysql\innodb_index_stats.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.

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 :(.

4条回答
姐就是有狂的资本
2楼-- · 2019-03-15 00:25

Move (DON'T DELETE) those files, into another folder:

innodb_index_stats.frm
innodb_table_stats.frm
slave_master_info.frm
slave_relay_log_info.frm
slave_worker_info.frm

and .ibd files with the same filename:

innodb_index_stats.ibd
innodb_table_stats.ibd
slave_master_info.ibd
slave_relay_log_info.ibd
slave_worker_info.ibd

Try start MySQL.

查看更多
来,给爷笑一个
3楼-- · 2019-03-15 00:30

This happens with Wordpress too. It only seems to happen with the latest version as I've rolled back to previous versions of AMPPS and it works fine without throwing up this innodb issue.

查看更多
Animai°情兽
4楼-- · 2019-03-15 00:38

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

  1. Edit my.cnf - find the line: # innodb_force_recovery = 2
  2. Comment the line in (remove the #)
  3. Restart MySQL to let the MySQL engine repair itself.
  4. Comment the innodb_force_recovery line in again (add #)
  5. Restart MySQL again and you have full access again without a Read-Only-Restriction.

Greetings from Germany

查看更多
▲ chillily
5楼-- · 2019-03-15 00:45

You can solve this problem by adding a line in your mysql config file: my.cnf or my.ini (depends on your distro)

just under [mysqld] add this line: innodb_force_recovery = 1

..
[mysqld]
innodb_force_recovery = 1 
..

Then restart your MySql Server. You could have lost some data but you'll get the server working again with your data.

Regards,

查看更多
登录 后发表回答