When I open XAMPP and click start MySQL button and it gives me an error. I had started it just before, but now it isn\'t working.
12:19:12 PM [mysql]
I got the same kind of 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'll have to read the error closely. This says that test_database
is preventing mysql from starting.
You could blow away the offending database, these steps fix the problem:
C:\xampp\mysql\data
test_database
.C:\xampp\mysql\data\mysql\backuptablespace
If it doesn't work, put the file back where you started and you'll be back where you started.
If you don't want to delete the database and don't have backups:
If you don't have backups of table data and mysql won't start because something is corrupted you'll have to use the process of elimination to guess-and-check your way to exactly what you did that corrupted it. Follow these steps:
C:\xampp\
and store it somewhere safe so you can get back to where you started.Try removing these files from C:\xampp\mysql\data\mysql
:
db.frm
db.MRD
db.MYI
db.opt
user.frm
user.MYD
user.MYI
When you get mysql to start, try putting things back until you find the one thing that you add which prevents it from starting. One bonus for this is you learn how mysql works under the hood.
Nuclear option:
Something you did screwed up the mysql server. An uninstall and reinstall of XAMPP should undo the corruption.