1

I recently upgraded XAMPP, and (stupidly, probably) simply copied my old mysql/data folder into the new installation. I'm not sure what version of MySQL I was running before, but it was probably 5.1. The new version is 5.6. Whenever I start MySQL now, I get this error:

2014-11-05 23:31:04 8784 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace db_name/table_name uses space ID: 2 at filepath: .\db_name\table_name.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 know from this question and others that deleting the ibdata1 and ib_logfile0 files temporarily solves this problem, but I need to do it each time I start XAMPP / MySQL. Is there a way to fix this problem permanently?

Community
  • 1
  • 1
wpnew
  • 11
  • 2
  • Can you create a mysqldump of the whole old database, restore (re-install) the new version of MySQL, and restore from the dump? – Harry Pehkonen Nov 05 '14 at 22:56
  • Removing ib_logfile0/1 may help in some situations, but DO NOT delete ibdata1. You are completely screwed after that. That either holds all your actual data, or if file_per_table is enabled it holds an internal dictionary pointers to the individual ibd files. – atxdba Nov 05 '14 at 22:58
  • Hmmm.. that SO question I linked to suggested deleting `ibdata1`, and that answer got 81 upvotes. But it's true that my db has been acting even weirder since... I think... I'd rather avoid re-installing. I wanted to know if there's a way to upgrade the dbs from 5.1 to 5.6... – wpnew Nov 05 '14 at 23:20
  • And the 3rd comment suggests it'll delete your data in the process, which it does. – mainstreetmark Nov 05 '14 at 23:26
  • Oh I don't doubt it. I guess re-installing is the only way. – wpnew Nov 05 '14 at 23:31

0 Answers0