Both my MySql server and client are running with local-infile=1
. It makes it possible form my to execute queries like these:
LOAD DATA LOCAL INFILE /var/data/report.csv INTO TABLE MyTable FIELDS TERMINATED BY ',' LINES TERMINATED BY '
' IGNORE 2 LINES (column1, column2, column3)';
All is good when I log-in to MySql server from the command line and then execute the query.
However, when I want to execute the same query with my application that's using Doctrine DBAL and db.driver: pdo_mysql
to conntect to the same database, I'm getting this error:
Syntax error or access violation: 1148 The used command is not allowed with this MySQL version
It appears that my setting of mysql client and server (local-infile=1
) are not 'respected' by Doctrine DBAL. The application's connection does not allow for LOAD DATA LOCAL INFILE
while the client and the db host do. Why is that? How can I configure my db connection to be able to execute LOAD DATA LOCAL INFILE
?