|
Posted by Dave on 08/02/05 00:55
On Mon, 01 Aug 2005 21:38:41 -0400, Bruce A. Julseth decided we needed to
hear:
> I have three users with access to my test MySQL databases, root plus two
> others. The following PHP code only works when the user is root. Otherwise
> it fails.
>
> $File = addslashes(getcwd() . "\Address.txt");
> $SQL = "Load Data InFile \"" . $File . "\" into table addresses";
> $result = mysql_query($SQL) or die("Failed to load data");
>
> Both users were created by root from a cmd prompt:
>
> grant all on * to user@localhost identified by 'mypw' with grant options;
>
> What is wrong so that the created users can execute the above code?
>
> Thanks.
>
> Bruce
Which db was current when you did the grant? If it was the mysql db,
then you probably just granted access to that rather than the ones
you intended to.
AFAIK (hopefully someone corrects if I'm wrong) a * on its own grants
only to the current db. You should change it to *.* if you want to grant
to all dbs, or use dbname.* for a specific db.
As an aside your privs are very broad here - I guess for test it doesn't
matter, but careful when you move to production.
--
Dave <dave@REMOVEbundook.com>
(Remove REMOVE for email address)
Navigation:
[Reply to this message]
|