title: ERROR 13 (HY000): Can't get stat of '/tmp/file1.csv' (Errcode: 2) while trying to import CSV file into MariaDB
body: <p>I am trying to import CSV file into MariaDB (version: 5.5.50-MariaDB MariaDB Server), using this command:</p>
  
  <pre><code>LOAD DATA INFILE 'file1.csv' 
  INTO TABLE table_name 
  FIELDS TERMINATED BY ',' 
  LINES TERMINATED BY '\n' 
  IGNORE 1 LINES  (@dummy,col1, col2,col3,@dummy) 
  SET col4 = "xyz";
  </code></pre>
  
  <p>I am getting error as:</p>
  
  <blockquote>
    <p>ERROR 13 (HY000): Can't get stat of '/var/lib/mysql/db_name/file1.csv' (Errcode: 2)</p>
  </blockquote>
  
  <p>I also tried using LOCAL keyword as per some suggestions on stackoverflow and google search in the above query like:</p>
  
  <pre><code>LOAD DATA LOCAL INFILE 'file1.csv' 
  INTO TABLE table_name 
  FIELDS TERMINATED BY ',' 
  LINES TERMINATED BY '\n' 
  IGNORE 1 LINES  (@dummy,col1, col2,col3,@dummy) 
  SET col4 = "xyz";
  </code></pre>
  
  <p>in that case, I get a file not found error:</p>
  
  <blockquote>
    <p>ERROR 2 (HY000): File 'file1.csv' not found (Errcode: 2)</p>
  </blockquote>
  
  <p>I have tried moving my source file to /tmp, /root and /var/lib/mysql/db_name directories but am not able to import using any of the above queries.</p>
  
  <p>Could anyone please suggest a solution?</p>
  
  <p>Thanks in advance.</p>