[MDEV-3878] Access denied for user Created: 2012-11-22 Updated: 2012-11-25 Resolved: 2012-11-22 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.5.25-galera |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | mtm | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Mageia Linux |
||
| Description |
|
This is new instalation, no update Then from the shell: I even created a valid Linux user with the name dbuser before adding it to database. Log file is useless: Nothing else |
| Comments |
| Comment by Sergei Golubchik [ 2012-11-22 ] |
|
This is expected behavior. It is explained in the manual, as a "very common mistake". You are connecting as dbuser@localhost. That is, you can see, that access is denied to dbuser@localhost. This happens, because you have the anonymous @localhost user, and MariaDB (and MySQL) sort accounts with a known host name before accounts with a wildcard (%) host name. And when you connect as dbuser@localhost it matches @localhost before it has a chance to match dbuser@%. You need either to create a user dbuser@localhost, or remove the anonymous @localhost user. |
| Comment by Elena Stepanova [ 2012-11-22 ] |
|
It looks like you have an anonymous user ''@'localhost' in your system. Since your newly created account doesn't have a specified host, the anonymous user with the host takes precedence. Please check MySQL documentation for more details on user authentication. Either remove the anonymous user (it's recommended for security reasons anyway), or specify your new one as 'dbuser'@'localhost'. Any of these should resolve the problem. |
| Comment by mtm [ 2012-11-25 ] |
|
Hi Sergei & Elena. Thank you very much for your answer. However I respectfully disagree with your assesment because this is an obvious behavioral bug. Let assume you have an UNIX system, at one point I am adding the anonymous user for anonymous FTP and as a result anyone's account starting with AO and beyond stops working. It just does not makes any sense at all. If this behaviour is expected based on the design then even if is not a codding bug it is a design bug. What would make sense is for the lookup to be based on user name and in the case that the same user name is specified with different hosts then the host shall take the second priority for security reasons. However, having a total different user name faulting somebody else it is still a bug, regardless if is specified in manual as a feature Thank you again, |
| Comment by mtm [ 2012-11-25 ] |
|
Hi Sergei & Elena. Thank you very much for your answer. However I respectfully disagree with your assesment because this is an obvious behavioral bug. Let assume you have an UNIX system, at one point I am adding the anonymous user for anonymous FTP and as a result anyone's account starting with AO and beyond stops working. It just does not makes any sense at all. If this behaviour is expected based on the design then even if is not a codding bug it is a design bug. What would make sense is for the lookup to be based on user name and in the case that the same user name is specified with different hosts then the host shall take the second priority for security reasons. However, having a total different user name faulting somebody else it is still a bug, regardless if is specified in manual as a feature Thank you again, |
| Comment by Sergei Golubchik [ 2012-11-25 ] |
|
I agree with that to an extent. In particular, the manual calls it "a very commont mistake" for a reason - people do it often, indeed. And I'd say that it's better to change the behavior to make this very common mistake impossible, instead of trying to document it. But this is the behavior that MySQL had, like, forever. Since 1998, or earlier. Changing it would be a big incompatible change, we need to approach it carefully. |