title: LOAD DATA INFILE does not work
body: <p>I am running <strong>MySQL</strong> on my <strong>Ubuntu</strong> machine. I checked <code>/etc/mysql/my.cnf</code> file, it shows my database temporary directory:</p>
  
  <pre><code>...
  basedir     = /usr
  datadir     = /var/lib/mysql
  tmpdir      = /tmp
  ...
  </code></pre>
  
  <p>As it shows, my MySQL server temporary directory is <code>/tmp</code> .</p>
  
  <p>I have a <code>students.dat</code> file, the content of this file is like following:</p>
  
  <pre><code>...
  30  kate    name
  31  John    name
  32  Bill    name
  33  Job     name
  ...
  </code></pre>
  
  <p>I copied the above <code>students.dat</code> file to <code>/tmp</code> directory. Then, I run the following command to load the data from <code>students.dat</code> file to the <strong>students</strong> table in my database:</p>
  
  <pre><code>LOAD DATA INFILE '/tmp/students.dat'
              INTO TABLE school_db.students
              FIELDS TERMINATED BY '\t'
              LINES TERMINATED BY '\n'
              (student_id, name, attribute)
  </code></pre>
  
  <p>But I got the error message in MySQL console:</p>
  
  <pre><code>ERROR 29 (HY000): File '/tmp/students.dat' not found (Errcode: 13)
  </code></pre>
  
  <p><strong>Why mysql can not find</strong> the <code>students.dat</code> file <strong>though the file is under mysql temporary directory?</strong></p>
  
  <p><strong>P.S.</strong> </p>
  
  <p>The <strong>students</strong> table is like following (there are already 4 records in the table before run the <code>LOAD DATA INFILE...</code> query):</p>
  
  <pre><code>mysql&gt; describe students;
  
      +-------------------+--------------+------+-----+---------+-------+
      | Field             | Type         | Null | Key | Default | Extra |
      +-------------------+--------------+------+-----+---------+-------+
      | student_id        | int(11)      | YES  |     | NULL    |       |
      | name              | varchar(255) | YES  | MUL | NULL    |       |
      | attribute         | varchar(12)  | YES  | MUL | NULL    |       |
      | teacher_id        | int(11)      | YES  |     | NULL    |       |
      +-------------------+--------------+------+-----+---------+-------+
      4 rows in set (0.00 sec)
  </code></pre>