I am having some problems getting this one sorted...
I am trying to import a CSV file into the database via a PHP script run with cron. I am getting the error "Syntax error or access violation: 1148 The used command is not allowed with this MySQL version". The import is done with PDO:
$this->database = new \PDO("mysql:host=".dbHost.";dbname=".dbTable, dbUserName, dbPassword, array(\PDO::MYSQL_ATTR_LOCAL_INFILE => TRUE));
$this->controller->putIntoDatabase("LOAD DATA LOCAL INFILE '".ftpPriceFileDestTXT."' INTO TABLE my_table FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n'");
As you can see, I have supplied the LOCAL_INFILE attribute. I have also added local-infile=1 to my.cnf under [client] and [mysqld] sections. All php.ini files (in directories /etc/php5/apache2, cgi and cli) contain mysqli.allow_local_infile = On under [MySQL] and [MySQLi] and are all uncommented.
If try in phpmyadmin, everything works fine with no errors and the full content of the file are imported. I just can't seem to get it working via cron (or via shell_exec). The argument given to both cron and the shell_exec function is
/usr/bin/php /home/full/path/to/my/script/cron.php suppliedArgument
I am running Ubuntu server 14.04 on a VPS box
I'm sure I must be missing something but don't know what, does anybody have any advice or suggestions for tackling this?