|
Posted by Bruce A. Julseth on 08/02/05 06:32
"Dave" <dave@REMOVEbundook.com> wrote in message
news:pan.2005.08.01.21.55.18.108530@REMOVEbundook.com...
> 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)
>
Okay. I'll try to grant with *.*. I'll also experiment with "Use"ing
different databases before root issues the grant. Thanks.
Question: What are "privs "? I don't understand your statement "As an aside
your privs are very broad here - I guess for test it doesn't matter, but
careful when you move to production." I'd appreciate if you could expand on
your comment. Thanks..
Bruce
Navigation:
[Reply to this message]
|