I am using mysql in Node.js 6.7.0 to get data from database
connection.query('SELECT * FROM table', function(err, results){
if(err){
console.log('Error while performing the database query:', err);
return;
}else{
console.log('Query results:', results);
}
});
I was normally opening the page (which was previously working) when I got an error:
Error while performing the database query: Error: Handshake inactivity timeout
The server didn't stop running, I refreshed the page and everything is ok...
It never happened before, what does this mean?
This is the full error that I got in the log:
Error while performing the database query: { Error: Handshake inactivity timeout
at Handshake.<anonymous> (/Users/johndoe/myproject/node_modules/mysql/lib/protocol/Protocol.js:160:17)
at emitNone (events.js:86:13)
at Handshake.emit (events.js:185:7)
at Handshake._onTimeout (/Users/johndoe/myproject/node_modules/mysql/lib/protocol/sequences/Sequence.js:127:8)
at tryOnTimeout (timers.js:232:11)
at Timer.listOnTimeout (timers.js:202:5)
--------------------
at Protocol._enqueue (/Users/johndoe/myproject/node_modules/mysql/lib/protocol/Protocol.js:141:48)
at Protocol.handshake (/Users/johndoe/myproject/node_modules/mysql/lib/protocol/Protocol.js:52:41)
at PoolConnection.connect (/Users/johndoe/myproject/node_modules/mysql/lib/Connection.js:136:18)
at Pool.getConnection (/Users/johndoe/myproject/node_modules/mysql/lib/Pool.js:48:16)
at Pool.query (/Users/johndoe/myproject/node_modules/mysql/lib/Pool.js:200:8)
at /Users/johndoe/myproject/myscript.js:92:13
at Layer.handle [as handle_request] (/Users/johndoe/myproject/node_modules/express/lib/router/layer.js:95:5)
at next (/Users/johndoe/myproject/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/Users/johndoe/myproject/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/Users/johndoe/myproject/node_modules/express/lib/router/layer.js:95:5)
code: 'PROTOCOL_SEQUENCE_TIMEOUT',
fatal: true,
timeout: 10000 }