title: How to fix: mysqli_query(): load data local infile forbidden
body: <p>When trying to upload a csv file to the server, nothing is happening to the database. The errors log file shows a warning stating that: load data local infile is forbidden.</p>
  
  <p>The same code runs perfectly in windows and ubuntu in localhost. But, on the server (ubunutu) things do not get working. We execute the same sql statement, as it is in php, on command line and it populates data on the database but when executing it in phpmyadmin it gives empty result.
  We tried most of the solutions found on internet regarding this issue, but nothing is working: we set local-infile to true, we granted FILE to the user, we set permissions to 777, etc.</p>
  
  <p>The sql statement is as follows:</p>
  
  <pre class="lang-php prettyprint-override"><code>...
  $sql = "LOAD DATA LOCAL INFILE 'path\to\file.csv' REPLACE INTO TABLE tablename FIELDS TERMINATED BY ';' ENCLOSED '\"' LINES TERMINATED BY '\\r\\n'";
  $result = mysqli_query($con, $sql);
  </code></pre>
  
  <p><strong>MySQL version:</strong> 5.0.12</p>