Patrick Connolly wrote:
Somewhere about Sat, 31-Jul-2004 at 11:17AM -0400 (give or take), Michael Stassen 
wrote:

|> With LOCAL, the *client* reads the file on the client's machine.
|> Without LOCAL, the *server* reeads the file on the server's
|> machine.  Even though the client and server machines are the same
|> in your case, those are still different operations.  There are
|> restrictions on having the server do the work, for good reason.
|> This is documented in the manual
|> <http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html>:

I'm pretty sure I understand the reasons.
|> : For security reasons, when reading text files located on the server,
|> : the files must either reside in the database directory or be readable
|> : by all.


Looks to me the mysql user should have no trouble with it:

-rw-rw-r-- 1 pat pat 332 Jun 28 20:42 Orders.txt

Every piece of the path to this file must be executable by mysql, as well.

|> : Also, to use LOAD DATA INFILE on server files, you must have
|> : the FILE privilege. See section 5.5.3 Privileges Provided by MySQL.

Think we can count that one out as the problem since LOCAL which would
have the same requirement does work.

The FILE privilege is not required with LOCAL. It is required without LOCAL, and for SELECT INTO OUTFILE. My bet would be that you don't have the FILE privilege. You can check with


  SHOW GRANTS FOR [EMAIL PROTECTED]

or by inspecting the File_priv column in the mysql.user table.

I can't be absolutely sure but I seem to remember I did not have this
problem when I used 3.23.47 before I 'rpm -U'ed to 4.0.18.  With the
Redhat distro version, I could *not* use LOAD DATA LOCAL unless I
started the client with --local-infile[=1] which seems to fit my
understanding of the docs.  With 4.0.18, it's unnecessary which was
another surprise to me.  Is there something I'm missing here?

How LOAD DATA LOCAL works was changed in 3.23.49 and 4.0.2. This is documented here <http://dev.mysql.com/doc/mysql/en/LOAD_DATA_LOCAL.html>.


|> |> Michael

Thanks Michael.

You're welcome.

Michael


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to