我的代码是这样的(大概是这样的):
this.con = mysql.createConnection({...});
this.con.connect(); // No error
this.con.destroy();
.......
.......
this.con.connect(); // error: Cannot enqueue Handshake after being destroyed.
最佳答案
在再次连接之前尝试重新创建/重新分配连接:
this.con = mysql.createConnection({...});
关于mysql - 如何在 Node js中销毁后连接mysql连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53676507/