How to bulk insert in mySql and node.js using mysljs

后端 未结 3 1282
抹茶落季
抹茶落季 2021-02-14 15:40

Im not able to use bulk insert in my DB using node.js lib mysljs.

I followed answers from:

How do I do a bulk insert in mySQL using node.js

with no succ

3条回答
  •  清歌不尽
    2021-02-14 16:33

    You need to mark your keys with the grave accent (backtick) character, like this: `key`

    Making your query like this:

    var sql = "INSERT INTO resources (`resource_container_id`, `name`, `title`, `extension`, `mime_type`, `size`) VALUES ?";
    

提交回复
热议问题