Here's your problem. In MySQL, when you log on it looks for all users
with a matching host, then it examines each user to match the username.
It also goes for the most specific one it can, which means it will take
'ken' over '%' if it can (where '%' is the wildcard character).
When you grant permissions to Ken, that's a shortcut for Ken@'%'.
However, when you try to log on, it finds the generic '%'@localhost
user to be a better match, since localhost is a better match for your
host than '%' is.
So the solution is to not only grant permissions for Ken (i.e. Ken@'%')
but also to grant them for Ken at localhost dot And if you're using local
storage only, then I suggest *only* defining the user as a localhost
user (and do the same for root - make sure it's only defined as a
localhost user), so somebody can't hack your database from somewhere
else.
BTW, this *is* mentioned in the documentation. If you look here
<http://www.mysql.com/doc/en/GRANT.html> you'll see, about halfway
down, a note mentioning what happens when you don't grant a localhost
user.
HTH,
Kevin
On Feb 29, 2004, at 2:02 PM, Ken & Deb Allen wrote:
$> mysql --user=root --password=xxxx mysql
mysql> CREATE DATABASE MyTrialDB;
mysql> GRANT ALL PRIVILEGES ON MyTrialDB.* TO Ken IDENTIFIED BY
'Allen';
mysql> exit
$> mysql --user=Ken --password=Allen MyTrialDB
ERROR 1045: Access denied for user: 'Ken at localhost' (Using password:
YES)
$>
--
Kevin Ballard
kevin at sb dot org
http://www.tildesoft.com
http://kevin.sb.org
- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|