I am trying to use the LOAD DATA LOCAL INFILE statement from MySQL and I am getting the error that "The used command is not allowed with this MySQL version".
The data file is local to the server running MySql. I can run the same command from MySql Workbench (installed on the same machine) and it works fine. This suggests to me that the server is setup to accept the command, and that the problem is probably with my PHP PDO client (again, on the same machine).
Here's the code where I create the PDO:
function getDb() {
$dsn = 'mysql:host=localhost;dbname=my_db';
$username = 'username';
$password = 'password';
$options = [PDO::MYSQL_ATTR_LOCAL_INFILE => true];
return new PDO($dsn, $username, $password, $options);
}
As you can see, I am setting the PDO::MYSQL_ATTR_LOCAL_INFILE
when I create the object.
Here's the sql command:
LOAD DATA LOCAL INFILE '/media/working/my_file.psv'
INTO TABLE MY_TABLE
FIELDS TERMINATED BY '|'
IGNORE 1 LINES
Any ideas?