Mysql issue when creating a new user

前端 未结 2 1987
礼貌的吻别
礼貌的吻别 2020-12-10 19:03
( SELECT DISTINCT User
                , Host 
             FROM mysql.user 
) UNION 
( SELECT DISTINCT User
                , Host
             FROM mysql.db 
) UNI         


        
相关标签:
2条回答
  • 2020-12-10 19:41

    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
    
    0 讨论(0)
  • 2020-12-10 19:54

    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

    0 讨论(0)
提交回复
热议问题