0

I'm completely confused with the CentOS's mysql server. It's 5.0.77 from CentOS 5.5.

I can't seem to create a user on that server. I've disabled the old_password option and restarted. I created a new user with:

GRANT SELECT ON db.table TO username IDENTIFIED BY 'some password';

It was correctly hashed to the new type password in mysql.user... but every time I try to login (either over socket, or network) I get:

ERROR 1045 (28000): Access denied for user 'username'@'localhost' (using password: YES)

I've never had problems with that in any other distro. Is there something centos-specific in the standard mysql package? How can I fix this situation?

viraptor
  • 1,264
  • 6
  • 21
  • 40

1 Answers1

2

The user must have access to log on from localhost Add the user again with:

GRANT SELECT ON db.table TO 'username'@'localhost' IDENTIFIED BY 'somepass';

Then you should be able to log on from localhost.

Frands Hansen
  • 4,617
  • 1
  • 16
  • 29
  • Yes, that works, but why? Unless I missed some exceptions in the database, `'username'@'%'` should match any connection anyways. – viraptor Feb 16 '11 at 23:58
  • Ok - I just noticed the sorting rules and centos putting `''@'localhost'` in the database by default. Silliness removed and now everything works as it should :) – viraptor Feb 17 '11 at 00:03