The server uses sorting rules that order rows with the most-specific Host values first. Literal host names and IP addresses are the most specific. (The specificity of a literal IP address is not affected by whether it has a netmask, so 192.168.1.13 and 192.168.1.0/255.255.255.0 are considered equally specific.) The pattern ‘%' means “any host” and is least specific. The empty string ” also means “any host” but sorts after ‘%'. Rows with the same Host value are ordered with the most-specific User values first (a blank User value means “any user” and is least specific).
请注意这句话:“The server uses sorting rules that order rows with the most-specific Host values first. Literal host names and IP addresses are the most specific.”
那么,当从本地连接到数据库时,匿名用户将覆盖其他如'[any_username]'@'%'之类的用户。具体匹配过程如下: