I am trying to load data from txt file (| separated) using simple php form. Bellow is the code :
$sql = "LOAD DATA INFILE '".$_FILES['file']['tmp_name']."'
INTO TABLE asn_data
FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '\"'
LINES TERMINATED BY '\r\n'
IGNORE 2 LINES
";
But when I browse the file and submit it shows following error:
File '/tmp/phpkR9fXW' not found (Errcode: 13)
If I change the syntax to LOAD DATA LOCAL INFILE
it provides following error:
The used command is not allowed with this MySQL version
My PHP version is 5.3.10, MySQL Version 5.5 and OS is Ubuntu 12.04.1 LTS.
I have tried solution given in http://ubuntuforums.org/showthread.php?t=822084 but no luck.