I have been using LOAD DATA INFILE to load an ASCII data file into my
database. The datafile is uploaded to the server temp area and the name of
the file is passed to LOAD DATA INFILE query like:

LOAD DATA INFILE '/tmp/phpyxCoes' INTO TABLE LocationTEMPSR12 FIELDS
TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r\n'

I now want to load data using LOAD DATA INFILE from a data file located
within my http_public directory. I can create a path to the file from my
DOCUMENT_ROOT, however passing that path to LOAD DATA INFILE generates this
error: (NOTE: I set the file permissions to 777)

Can't get stat of '/home/path_to_my_file/datafile.txt' (Errcode: 13)

Now if I just create a query like:

LOAD DATA INFILE 'datafile.txt' INTO TABLE LocationTEMPSR12 FIELDS
TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r\n'

I get this error
File './my_database_name/datafile.txt' not found (Errcode: 2)

Which seems to tell me that LOAD DATA INFILE is looking for my data file in
a location that is outside my hosting account. I just have an account with a
shared hosting service provider.

So how would I specify a path to a file that is outside the directory where
my database is located?

OBSERVATION: It appears the tmp directory must be in the database path
because, files uploaded to the tmp dir can be loaded using LOAD DATA INFILE.

Thanks for replies,
Chris





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

Reply via email to