I am using node.js and mysql, to run sql commands frequently.
I am getting this error: Cannot enqueue Handshake after invoking quit.
This is when I do
connection = mysql.createConnection(sqlDetails);
connection.connect();
and
connection.end();
If I comment the .connect and .end lines, then I get the error ER_CON_COUNT_ERROR: Too many connections.
Does anyone know how to fix this problem?
Thanks
connection.end(). It saysYou can listen on the error event to handle server disconnection and for reconnecting purposes.but im not sure which function to put it in...