Nodejs and MySQL: LOAD DATA INFILE sends error "No such file or directory"

0

I want to do a LOAD FILE from Mysql from Nodejs but I get an error

{ Error: EE_STAT: Can't get stat of '/var/www/node/importacion/api/csv_files/bulk_for_mysql_410201713121.txt' (Errcode: 2 "No such file or directory")

My script is as follows:

conexion.query("LOAD DATA LOCAL INFILE '/var/www/node/importacion/api/csv_files/"+archivo+"' INTO TABLE cuentas FIELDS TERMINATED BY '|';", function(err, rows, fields){
   if(err){
     reject(err);
   }
   console.log(rows);
   resolve();
});

The txt file is on that route

    
asked by Ricky 04.10.2017 в 20:57
source

0 answers