LOAD DATA LOCAL INFILE

been searching all day on how to do this in Yii2 please help. I am trying to load a csv file that I dynamically generate with php, but keep getting the error


Syntax error or access violation: 1148 The used command is not allowed with this MySQL version

I’ve tried setting in the config file




'attributes' => [

   PDO::MYSQL_ATTR_LOCAL_INFILE => true,

],



it does not work, I’ve tried setting the local-infile=1 in the /etc/mysql/my.cnf still a no go.

I am connected to the remote database via SSH tunnel.

if your dataset is not very large, you could try to parse the data in php arrays and then dump into to the databse

Thanks for the respon alirz23. Yeah, I end up doing just that, as the LOAD DATA way of doing it was much more trivial, requiring me to programatically upload the csv file in order to be able to LOAD it locally.