php - Node.js crashing automatically by mysql without any operation in it -
i working node.js , facing problem crashing of node . error message shown below.
error: connection lost: server closed connection. @ protocol.end (/var/www/versions/project/js/node_modules/mysql/lib/protocol/protocol.js:78:13) @ socket.<anonymous> (/var/www/versions/project/js/node_modules/mysql/lib/connection.js:81:28) @ socket.eventemitter.emit (events.js:117:20) @ _stream_readable.js:919:16 @ process._tickcallback (node.js:419:13)
i'm using mysql queries in node server..but @ crashing time not have operation on it... node crashing automatically different period of time.
i have found working connection pools grab connection when need best approach.
// once var pool = mysql.createpool( opts ); // then, before need connection pool.getconnection(function(err, connection) { if (err) throw err; // use connection // don't forget release connection when done... connection.release(); });
Comments
Post a Comment