by Novaxampp » 10. April 2022 16:35
This was happening with xampp version 8.0.12
I found the solution on StackOverflow in this post: https://stackoverflow.com/questions/62797324/unable-to-start-mysql-via-xampp-mysql-db-crashed
I made a video of the steps below which you can watch at: https://www.screencast.com/t/aNaXzyDsOlz
The text instructions are:
Find and open the 'my.ini' file with Notepad. (Mine is at c:\xampp\mysql\bin\my.ini ) NOT the one in the "data" folder.
Insert 'skip-grant-tables' in the 'my.ini' file on a new line following the label '[mysqld]' and save. You will remove this after the problem is fixed.
Now mySQL you can start XAMPP from the control panel.
Start phpMyAdmin from your browser and select the table 'db' from the database 'mysql' (Select 'mysql' from left panel then check 'db' in right hand panel).
Beneath from the 'With selected' dropdown, run 'analyze' (it should say that it is corrupted). Then select again and run 'repair table'.
Find the 'my.ini' file again and open with Notepad.
Remove 'skip-grant-tables' in the 'my.ini' file and save.
Problem should be fixed and you should be able to start XAMPP normally which will start MySQL normally.