You are using...
- Windows
- XAMPP
- PHPMyAdmin
- You want to continue your work from yesterday
- You opened up MySQL from the XAMPP control panel
- It tells you that your SQL has occurred some problem
- You Googled, but can't fix
- You decided to reinstall XAMPP
- You are lazy to recreate those tables and users
- You copied folders in
C:\xampp\mysql\data
, and paste them to the newly installed MySQL folder. - Your database is coming back.
- But there are more problem has occurred..., like users db has blow up.
- Copy all your tables folder and a file called
ibdata1
fromC:\xampp\mysql\data
. - Reinstall xampp
- Paste the folders and
ibdata1
you just copied to the newly installed MySql folder.
Error Message from phpmyadmin:
Index for table 'db' is corrupt; try to repair it
- Open terminal then cd to
C:\xampp\mysql\bin
, and run the following command to fix it.
.\mysqlcheck.exe -u root -r --database mysql --use-frm
Now you just need to recreate your users, everything else is back.
Don't touch global_priv
table inside mysql folder, I once touched, then it blew up again.
If you have any better soluation, plz leave a comment.