LOAD DATA INFILE Problem
I have 3 files in /tmp shown here:
[root@localhost tmp]# ls -al | grep txt
-rw-rw-rw- 1 mysql mysql 179 Aug 31 16:53 data0.txt
-rw-rw-rw- 1 mysql mysql 179 Aug 31 16:58 data1.txt
-rw-rw-rw- 1 mysql mysql 179 Aug 31 16:52 data2.txt
Their contents, permissions, and ownership are all identical. As far as I know, the only difference between them are the file names. However, when I try to import their contents into a table, here are the results:
mysql> load data infile "/tmp/data0.txt" into table test.test;
ERROR 13 (HY000): Can't get stat of '/tmp/data0.txt' (Errcode: 13)
mysql> load data infile "/tmp/data1.txt" into table test.test;
ERROR 13 (HY000): Can't get stat of '/tmp/data1.txt' (Errcode: 13)
mysql> load data infile "/tmp/data2.txt" into table test.test;
ERROR 1062 (23000): Duplicate entry '1' for key 1
My first question is why are the first two coughing up permission errors? These are files owned by mysql in the /tmp directory.
My second question is why does the last file produce a different result from the first two, given that their only apparent difference is file name? I'm at my wit's end on this one.
Here is a bit more relevant information...
mysql> show variables like '%secure_file%';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| secure_file_priv | |
+------------------+-------+
1 row in set (0.00 sec)
mysql> select File_priv from mysql.user where user = "<removed>";
+-----------+
| File_priv |
+-----------+
| Y |
| Y |
| Y |
| Y |
+-----------+
4 rows in set (0.00 sec)
Subject
Written By
Posted
LOAD DATA INFILE Problem
August 31, 2009 03:14PM
September 01, 2009 03:12PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.