Here's the question, as succinctly as I can formulate it:
The documentation seems to say that one can load a tab-delimited text
file located in the current directory of the client host into a
database by running the client mysql and executing the following
command:
mysql> LOAD DATA LOCAL INFILE "absence.txt" into table absence;
When "absence.txt" is located in
"/Users/jack/Desktop/SQL_stuff/samp_db/", then the command:
mysql> LOAD DATA LOCAL INFILE "/Users/jack/Desktop/SQL_stuff/samp_db/
absence.txt" into table absence;
does work.
But the command:
mysql> LOAD DATA LOCAL INFILE "absence.txt" into table absence;
does not work. Rather, it produces the error:
ERROR:
File 'absence.txt' not found (Errcode: 2)
That is, absolute pathnames work, but relative pathnames do not.
I have been careful to be sure that, when invoking the mysql client, I
am in the correct directory, and that when I invoke mysql, that I
include the --local-infile option, as the following printout shows:
[Jacks-G4:~/Desktop/SQL_stuff/samp_db] jack% mysql --local-infile
samp_db
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 14 to server version: 3.23.52-entropy.ch
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> LOAD DATA LOCAL INFILE "absence.txt" into table absence;
ERROR:
File 'absence.txt' not found (Errcode: 2)
I have concluded that one cannot use the relative pathname of a file
in the LOAD DATA LOCAL INFILE command. I hope I am wrong, as it would
be nice to use the simpler, relative, pathname.
Am I wrong or right? If wrong, what am I missing?
Jack Connolly
Hanover, MA
[EMAIL PROTECTED]
---------------------------------------------------------------------
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
- RE: LOAD DATA LOCAL INFILE Jay Blanchard
- RE: LOAD DATA LOCAL INFILE Jay Blanchard
- LOAD DATA LOCAL INFILE brent
- load data local infile nellA hciR
- RE: load data local infile Lukoni, Bryan AG:EX
- Re: load data local infile nellA hciR
- load data local infile Pallavi Arun Patil
- Re: load data local infile David Neil
- re: load data local infile Victoria Reznichenko
- re: LOAD DATA LOCAL INFILE John Connolly
- re: LOAD DATA LOCAL INFILE Victoria Reznichenko
- LOAD DATA LOCAL INFILE John Connolly
- re: LOAD DATA LOCAL INFILE Victoria Reznichenko
- LOAD DATA LOCAL INFILE John Connolly
- RE: LOAD DATA LOCAL INFILE Michael Ryan
- load data local infile Yuyi Guo
- Re: load data local infile Rich Allen
- Re: load data local infile Yuyi Guo
- Load Data Local Infile Jon Bertsch
- load data local infile Terence Ng