Oct1a

node 创建触发器出现check the manual that corressponds to yours Mysql server version for the right syntax to use near ‘DELIMITER //‘


code: 'ER_PARSE_ERROR',
  errno: 1064,
  sqlMessage: "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 'DELIMITER //\r\n" +
    "CREATE TRIGGER `device_group_before_insert` BEFORE INSERT ON `devi' at line 1",
  sqlState: '42000',
  index: 73,

原本想通过node来动态创建数据库,因为数据库中有触发器,导致出现触发器无法创建的错误

image-20211223174603459

解决方法:

DELIMITER // 替换为空即可

按自己理解的话,可能是因为DELITMITER是关键字,mysql库在解析的时候出现错误了,直接删除该句是不影响创建的

本作品采用 知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议 进行许可。