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