I'm trying to set up my php script to load an enormous amount of data in from a CSV file. my queries are working fine for everything but this LOAD DATA INFILE command. i know the sql works because i ran it from the mysql command line logged in as root. the core issue seems to be that i cannot provide FILE privileges to the user.
does anyone know how to fix this? i'm apache/php 4.3/mysql 3.23.58. again, other queries run just fine for this user...FILE privelege seems to the sticking point.
<?
include("foo.php");
echo "data import page<br>";
$sql = "LOAD DATA INFILE 'some/abs/path/data_import/_chump.csv'
INTO TABLE _chump
FIELDS
TERMINATED BY ','
OPTIONALLY ENCLOSED BY '\"'
ESCAPED BY '\\\\'
LINES
TERMINATED BY '\\r\\n'";
echo $sql . "<br>";
if (!($result = $db->sql_query($sql))) {
die('Could not import file:' . mysql_error());
}
?>