I have the same error in my C:\xampp\mysql\data\mysql_error.log when trying to start mysql.
2013-08-05 01:20:32 6780 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace mysql/slave_relay_log_info uses space ID: 3 at filepath: .\mysql\slave_relay_log_info.ibd. Cannot open tablespace test_database/test_table which uses space ID: 3 at filepath: .\test_database\test_table.ibd
You will have to carefully read the error. This suggests that test_database prevents mysql from starting.
You can bring down a corrupting database, these steps fix the problem:
- Make sure mysql and xampp are completely closed.
- Go to the directory where mysql is installed, mine:
C:\xampp\mysql\data - You should see a folder with the name of the database you created. mine was
test_database . - Create a new folder elsewhere called
C:\xampp\mysql\data\mysql\backuptablespace - Drag (do not delete) the corrupted database table folder into the backup directory.
- Try running mysql again. For me, it started right after 1 second, as expected.
If this does not work, return the file to where you started, and you will return to where you started.
If you do not want to delete the database and do not have backups:
If you do not have backup copies of the table data, and mysql does not start because something is damaged, you will have to use the repair process to guess and check your path to what you did that messed it up. Follow these steps:
- Make a clone of all
C:\xampp\ and keep it somewhere safe so that you can return to where you started. - Use the binary search method to try to find the damaged item in the mysql database. It can be a file, or a table, or a database, or a user, or something else.
- Delete the entire database and see if it allows you to start mysql. If so, return the database and try deleting some of the tables. If this is not the case, try pulling something else out before it starts.
Try deleting these files from C:\xampp\mysql\data\mysql : db.frm db.MRD db.MYI db.opt user.frm user.MYD user.MYI
When you start mysql, try returning everything until you find one thing you add that will prevent it from starting. One bonus for this is that you will learn how mysql works under the hood.
Nuclear option:
Something you messed up with the mysql server. Removing and reinstalling XAMPP should undo the damage.
Eric Leschinski Aug 08 '13 at 17:25 2013-08-08 17:25
source share