NodeJs 不能同时执行多条Sql语句?

同时执行多条语句会报错:Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select found_rows() as total' at line 1

Winter2018/10/26 11:19:52

由于Node mysql做了安全的限制,想要执行多条sql语句,需要打开对应开关配置


var mysql = require('mysql');
var pool  = mysql.createPool({port:"..", host, "...", ... , multipleStatements: true});

在配置中添加multipleStatements: true