Victoria and Michael:

Thanks very much.

Following on your suggestions, I then went ahead and put the text file into my directory:

/usr/local/mysql

so that the file was then /usr/local/mysql/absence.txt

and, with that done, the

LOAD DATA LOCAL INFILE "absence.txt" into table absence;

command in the mysql client successfully did load it.

(It didn't work when put into the /usr/local/mysql/scripts directory or in the /usr/local/mysql/data directory.)

Is there anyway to change the place where the client looks when given the relative pathname of a file to be LOADed, or is one stuck with having to put all text files in that one immutable location?

(On the Mac, we aren't allowed to see the contents of /usr/local/mysql/ in the GUI. We have to access it through the UNIX Terminal program, and then fiddle with permissions, which, I am not bashful to say, I am reluctant to start doing without comprehending the implications, which, I also am not bashful to say, I don't.)

Thanks again.

Best,

Jack Connolly
Hanover, MA

P.S. -- Is this how I am supposed to reply to responses, i.e., by directing them back to the list, as opposed to the individual?

Thnx,

J.

On Thursday, November 28, 2002, at 09:23 AM, Michael Ryan wrote:

The MySQL Manual states the following in the LOAD DATA INFILE section :-

If a filename with no leading components is given, the server looks for the file in the database directory of the current database.

On Thursday, November 28, 2002, at 10:42 AM, Victoria Reznichenko wrote:

John,

Thursday, November 28, 2002, 2:12:27 AM, you wrote:

JC> Here's the question, as succinctly as I can formulate it:


JC> The documentation seems to say that one can load a tab-delimited text
JC> file located in the current directory of the client host into a
JC> database by running the client mysql and executing the following
JC> command:

JC> mysql> LOAD DATA LOCAL INFILE "absence.txt" into table absence;

JC> When "absence.txt" is located in
JC> "/Users/jack/Desktop/SQL_stuff/samp_db/", then the command:

JC> mysql> LOAD DATA LOCAL INFILE "/Users/jack/Desktop/SQL_stuff/samp_db/
JC> absence.txt" into table absence;

JC> does work.

JC> But the command:

JC> mysql> LOAD DATA LOCAL INFILE "absence.txt" into table absence;

JC> does not work. Rather, it produces the error:

JC> ERROR:
JC> File 'absence.txt' not found (Errcode: 2)

JC> That is, absolute pathnames work, but relative pathnames do not.

JC> I have been careful to be sure that, when invoking the mysql client, I
JC> am in the correct directory, and that when I invoke mysql, that I
JC> include the --local-infile option, as the following printout shows:

JC> [Jacks-G4:~/Desktop/SQL_stuff/samp_db] jack% mysql --local-infile
JC> samp_db

JC> Reading table information for completion of table and column names
JC> You can turn off this feature to get a quicker startup with -A

JC> Welcome to the MySQL monitor. Commands end with ; or \g.
JC> Your MySQL connection id is 14 to server version: 3.23.52-entropy.ch

JC> Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

JC> mysql> LOAD DATA LOCAL INFILE "absence.txt" into table absence;
JC> ERROR:
JC> File 'absence.txt' not found (Errcode: 2)

JC> I have concluded that one cannot use the relative pathname of a file
JC> in the LOAD DATA LOCAL INFILE command. I hope I am wrong, as it would
JC> be nice to use the simpler, relative, pathname.

JC> Am I wrong or right? If wrong, what am I missing?

If you don't use absolute pathname, your file must be located in the
client program/script directory (in your case mysql client program)



--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Victoria Reznichenko
/ /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED]
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net
<___/ www.mysql.com





---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to