( SELECT DISTINCT User
, Host
FROM mysql.user
) UNION
( SELECT DISTINCT User
, Host
FROM mysql.db
) UNI
I also ran into the
"Error: mysqlcheck doesn't support multiple contradicting commands"
issue using the following command
mysqlcheck -u root -p --auto-repair -c -o --all-databases
What I did, and its because I am lazy lol, was run everything separately and used the -r
for repair instead of --auto-repair
mysqlcheck -u root -p -r --all-databases
mysqlcheck -u root -p -c --all-databases
mysqlcheck -u root -p -o --all-databases
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