Answer the question
In order to leave comments, you need to log in
Why is mysql dropping the connection?
From time to time the application crashes with the following error:
Error: Connection lost: The server closed the connection.
at Protocol.end (/srv/arcoin/node_modules/mysql/lib/protocol/Protocol.js:109:13)
at Socket.<anonymous> (/srv/arcoin/node_modules/mysql/lib/Connection.js:115:28)
at emitNone (events.js:91:20)
at Socket.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'localhost',
user : 'test',
password : 'test',
database : 'test'
});
connection.connect(function(err) {
if (err) {
console.error('error connecting: ' + err.stack);
return;
}
});
module.exports = connection;
var connection = mysql.createPool({
connectionLimit : 30,
host : 'localhost',
user : 'test',
password : 'test',
database : 'test'
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question