New users host using mysql% but can not connect using localhost

Today created a new user, also gave permission, host set for%

However, there are mistakes that user connection

View user

mysql> select host,user,password from mysql.user;
+-----------+-----------+-------------------------------------------+
| host | user | password |
+-----------+-----------+-------------------------------------------+
| localhost | root | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| 127.0.0.1 | root | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| ::1 | root | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| localhost | | |
| % | bimengine | *8EB0795119E0710F8C06D70E679FFFFE390A2BCC |
+-----------+-----------+-------------------------------------------+

the reason:

  Some additional mysql.user table record generating the effect is most likely already have a '' @localhost recorded is the user name is blank, the host field is recorded localhost

  Host column value anonymous user account '%' account more specific than 'bimengine' @, in the user table top surface

Solution:

  Delete anonymous account, or give it a specific name, restart mysql, problem solving

Guess you like

Origin www.cnblogs.com/baby123/p/11431392.html