Mysql issue when creating a new user

巧了我就是萌 提交于 2020-05-23 09:54:51

问题


( SELECT DISTINCT User
                , Host 
             FROM mysql.user 
) UNION 
( SELECT DISTINCT User
                , Host
             FROM mysql.db 
) UNION 
( SELECT DISTINCT User 
                , Host 
             FROM mysql.tables_priv 
) UNION 
( SELECT DISTINCT User
                , Host 
             FROM mysql.columns_priv 
) UNION 
( SELECT DISTINCT User
                , Host 
             FROM mysql.procs_priv 
) ORDER 
     BY User ASC
      , Host ASC

Mysql said:
`#1030 - Got error 176 "Read page with wrong checksum" from storage engine Aria`

[Error here][1]


  [1]: https://i.stack.imgur.com/PysWf.png

回答1:


I too 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



回答2:


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



来源:https://stackoverflow.com/questions/58765779/mysql-issue-when-creating-a-new-user

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!