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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -