Are Users 'User'@'%' and 'User'@'localhost' not the same?

前端 未结 4 1971
长发绾君心
长发绾君心 2020-12-05 01:59

I created a user per the first command but cannot logon via localhost (linux). This link mysqldoc indicates that I need to create a second user by the same name, but usin

4条回答
  •  天命终不由人
    2020-12-05 02:51

    I encountered the same situation as described - Adding an entry for user@% was not working.

    Yet adding an entry for the same user@localhost would start to work again though. This did seem unintuitive, given our understanding of the % pattern!

    An issue identified by Kent above was that: We had an entry row in the users table for host:localhost but the user was blank. This apparently resolved to a rule for %@localhost which was being used as a match before my user@% rule.

    Short answer - check for blank or wildcard usernames in your user table.

    ... I have no idea how that blank got there or if it was intentional.

提交回复
热议问题