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)
Виктор Судаков

December 2024

S M T W T F S
1234567
891011121314
15161718192021
22232425262728
293031    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 15th, 2025 09:27 pm
Powered by Dreamwidth Studios