Chris wrote:
Thank you for your detailed response.
You're welcome.
It seems my problem is trying to define the path to my data file and this is
where I seem to be missing something.
No, the problem is permissions. As I explained previously, a relative
path (one without a leading /) means a location under mysql's data
directory, not a location relative to your script. That's why you get a
"No such file or directory" error when you tried a relative path.
Hence, to load a file not under mysql's data directory, you must use an
absolute path (one starting with /), as you did originally. Note that
with the absolute path, you got a "Permission denied" error, not a "No
such file or directory" error. Mysql could not read the path you gave it.
Permissions on all directories in the
path are by default set to 755 except for the director at the top of the
directories in my hosting account public_html which is set to 750.
As I said, *every* directory in the path must be readable by mysql.
Your top directory has 750 permissions, so, unless it is owned by user
mysql or in the mysql group, mysql cannot access it. Either set it to
751, or change it to group mysql.
If I look at:
LOAD DATA INFILE '/tmp/phpyxCoes' INTO TABLE LocationTEMPSR12 FIELDS
TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r\n'
which works from my tmp directory. The tmp directory is at the same level as
public_html and has permissions 700.
I'm sorry, but I just don't believe that. Permissions are user, group,
world, in that order, so 700 means only the owner can access /tmp. If
mysql can access /tmp, either /tmp is owned by mysql, which would be
strange, or it doesn't have 700 permissions. Do this
cd / && ls -aFl
and include the lines for . and tmp and public_html in your next post.
So I guess I don't know why I can't
specify the location of my data file from
'/public_html/path_to_my_file/datafile.txt'
You can, if you can fix the permissions.
Thanks,
Chris
P.S. It might be a good idea `man chmod` to review file permissions.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]