InnoDB: Attempted to open a previously opened tablespace

旧街凉风 提交于 2019-11-29 19:37:15

I had the same problem. I tried all the solution others has proposed, and unfortunately nothing worked.

After spending hours on searching for the solution in Google I finally found this

  1. Open my.ini (my.cnf on linux-based systems and Mac)
  2. Look for [mysqld]
  3. Just below [mysqld] insert innodb_force_recovery = 1
  4. Start MySQL Service
  5. Stop MySQL Service
  6. Remove the line from my.ini (innodb_force_recovery = 1)
  7. Start MySQL Service

Worked perfect in my case.

I hope this will solve your problem.

I got the same error. These are the steps I followed.

  1. Took the backup of \xampp\mysql\data

  2. Removed all the files and folders from data folder except mysql

  3. Quit and started the XAMPP again.

  4. Move the databases from data folder one by one.

try to rename /Applications/XAMPP/xamppfiles/var/mysql/ib_logfile0 to /Applications/XAMPP/xamppfiles/var/mysql/ib_logfile0.bkp

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

Solution is for MAC 10.11.3 El Captian

  • Go to /Applications/XAMPP/xamppfiles/var/mysql/
  • Delete all random files (except the actual database folders)
  • Restart Apache and MySQL.

This worked for me.

Leandro Castro

To use the above (Nesar solution) in MAMP (version >= 4), you must first copy the my.cnf file that is inside MAMP/tmp/mysql to the MAMP/conf folder. Only then will it work.

I had a similar problem with Mamp Pro. For me it turned out the correct .idb-files were not located at "Applications/Mamp...". So taking a closer look at the error-log it showed me the files were located at "/Library/Application Support/appsolute/MAMP PRO/db". As I had problems with a database I wasn't using anymore, I just tried to delete the corresponding folder and it worked out. The next step would have been to delete the files already mentioned by the author.

  • 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

But as mentioned deleting the databasefolder worked out great.

Tgr's answer looks appropriate. The message about permissions etc. is a generic one; the actual error message is

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

Your wiki database and phpmyadmin database somehow ended up with the same tablespace ID. Each would work fine if the other wasn't present; as it is now, you'll have to renumber one of them somehow.

"Attempted to open a previously opened tablespace." -- That smells like one of these:

  • There are two copies of MySQL and both are trying to run.
  • Windows failed to release an 'open' on one of MySQL's files. I used to see that problem. It was cured by rebooting Windows; later by upgrading Windows.

Another solution for the issue discribed above for MAMP Pro, as I found impossible to edit my.cnf properly :

When InnoDB is crashing, spot in the error message the DB that is causing trouble. Here it is phpmyadmin/pma__tracking so the table is the one with the pma_ extension.

Then go to /Library/Application Support/appsolute/MAMP PRO/db/mysql and remove the folder named after the problem causing DB.

Restart your MAMP server. Once you restarted with success, you can stop servers again, put back the DB folder where it belongs and start the servers again. Everything should be fine again.

I had the same problem, after use recovery database structure ( http://zadpen.com/20-restore-lost-data-in-mysql-using-innodb-engine-without-file-ibdata1.html ) I remove the archive.ibm file and start mysql. then create archive table in database.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!