You are here: Re: Load Data InFile fails « PHP Programming Language « IT news, forums, messages
Re: Load Data InFile fails

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация