I have been researching this issue for 2 days now and all the questions and answers do not solve my problem.
Found! in the mysql_error.log after running it several times:
2020-01-06 16:34:11 0 [ERROR] mysqld.exe: Table '.\mysql\user' is marked as crashed and last (automatic?) repair failed
2020-01-06 16:34:11 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table '.\mysql\user' is marked as crashed and last (automatic?) repair failed
So now I see the issue after numerous times trying to start MySQL and reviewing the log, this time I finally see the "user" table is corrupt.
Can anyone advise how to repair this?
First, from XAMPP control panel, open "Config" [mysql] and add the following line under [mysqld] = innodb_force_recovery = 1
then do the following:
Open shell from control panel and start mysql with this command:
mysqld –-console –-skip-grant-tables –-skip-external-locking
Open another shell from control panel and repair database with this command:
mysqlcheck -r --databases mysql --use-frm
Stop mysql, close shells and restart mysql normally.
IF it doesn't work then change innodb_force_recovery = 2 and repeat process, and again if that doesn't work, change to 3, etc... up to 4
You can find this answer useful
I saw this answer in an unclear form here on stackOverflow which helped me, hope this answer helps too
1 - open the directory "c:/xampp/mysql/data" and remove the folder "mysql"
2 - now you will copy the "mysql" folder from "c:/xampp/mysql/backup" and then paste it in the "c:/xampp/mysql/data" directory
Hope this answer helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With