If your mysql doesn't start from XAMPP and in the Windows event viewer you see the following error: "mysqld: Index for table '.\mysql\db' is corrupt; try to repair it" i> we have found 3 ways to fix it.
It's very simple.
Open the console/shell from your XAMPP control panel. Paste this code: mysqld --console --skip-grant-tables --skip-external-locking
Open another shell(without closing the first one) and type:
mysqlcheck -r --mysql databases --use-frm
Close the 2 shells and you should be able to start (if not already started).
Mysql has a backup folder where it saves a copy of the tables.
The backup folder can be found, if you have the default path in Windows, in the following path: "c:\xampp\mysql\backup"
Make a copy of the original db table (in this case the db table) (usually 3 files), which is inside "c:\xampp\mysql\data" (or change- name it) and right there copy the db table (the 3 files) that is inside the backup folder.
By doing this you may be able to start mysql
Try starting mysql to check.
Although you may get other errors with other tables, you can fix them from phpmyadmin.
Restore the corrupted files (db.xx that you have renamed) with the original name and those that we have rescued from the backup folder, delete them. Since you already have mysql started, use, for example, phpmyadmin to repair the corrupted db table.
The summary would be, you have used the copy db table to start and once started, use phpmyadmin to repair damaged DB table files.
It worked for us