realbasic-nug
[Top] [All Lists]

Re: Problem with MySQL 4.0.15 and REALbasic 5.2.4

To: "REALbasic Network Users Group" <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Problem with MySQL 4.0.15 and REALbasic 5.2.4
From: Kevin Ballard <kevin at sb dot org>
Date: Mon, 1 Mar 2004 00:08:16 -0500
Cc: Ken & Deb Allen <kendrhyd at sympatico dot ca>
References: <20040229161935 dot TFBK17981 dot tomts32-srv dot bellnexxia dot net at lists dot realsoftware dot com> <C49CDD58-6AE9-11D8-86F6-000A95EB61DC at sympatico dot ca>
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>

<Prev in Thread] Current Thread [Next in Thread>