Don't really know if the cause of the issue is same, but I fixed this issue with mysqlcheck
. Run
mysqlcheck -c -u root -p --all-databases
in terminal (after you run this, you will be prompted for root password if you have set it).
Running this and browsing through the output, I found the issue was with tables_priv
table in mysql
database. So I repaired it using the -r
flag of mysqlcheck
.
mysqlcheck -r mysql tables_priv -u root -p
(again, it will prompt for password, enter it). And that fixed it. Don't really know the cause of the issue, but hope this can help anyone else who faces same issue.
You can also run
mysqlcheck -u root -p --auto-repair -c -o --all-databases
to automatically fix all corrupted tables without needing to find which one is corrupted (don't know if this will affect any of your other tables negatively, so try the first option and try this if you fail).
You can get more info about mysqlcheck
from here