Nov. 4th, 2017

victor_sudakov: (Default)
Если завел пользователя 'finley'@'%', а его не пускает к базе с ошибкой "access denied for finley@localhost, то сперва думаешь "какого хрена, ведь % значит с любого хоста", а потом находишь в документации неочевидный момент:

Two accounts have a user name of finley. [...] The 'finley'@'localhost' account can be used only when connecting from the local host. The 'finley'@'%' account uses the '%' wildcard for the host part, so it can be used to connect from any host.

The 'finley'@'localhost' account is necessary if there is an anonymous-user account for localhost. Without the 'finley'@'localhost' account, that anonymous-user account takes precedence when finley connects from the local host and finley is treated as an anonymous user. The reason for this is that the anonymous-user account has a more specific Host column value than the 'finley'@'%' account and thus comes earlier in the user table sort order.


https://dev.mysql.com/doc/refman/5.6/en/adding-users.html

Если бы сообщение гласило "Access denied for user ''@'localhost' ", то было бы сразу понятно, что на самом деле finley is treated as an anonymous user, но вот сделано почему-то так.

Profile

victor_sudakov: (Default)
Виктор Судаков

November 2025

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Dec. 15th, 2025 12:33 am
Powered by Dreamwidth Studios