Bulk upload into MySQL using Node.js Express -


i want node.js application uploads csv file e.g. employee.csv , dumps employee data mysql database.

i in uploading file server when i'm executing query bulk upload cause 500 error, i'm able figure out exact cause of error.

app.post('/bulkemployeefile',function(req,res,next){  var fullpath = __dirname + "\\uploads\\" + filename;     query = "load data infile '" +fullpath+ "' table user fields terminated ',' ignore 1 lines;";  pool.getconnection(function(err, connection){         connection.query(query, function(err, rows, fields) {             if (err)                 console.log('error while performing query.');                else{                    connection.release();                 res.redirect('/bulkemployee?done=true');             }         });      });  }); 

i suppose connection.query not able execute load data infile.

can 1 me how accomplish bulk upload mysql.

thanks in advance.


Comments