严重错误后节点JS Mysql协议ENQUEUE

错误的含义是什么?

此代码在我的testing文件中工作。

function handleDisconnect() { objConn = mysql.createConnection(db_config); // Recreate the connection, since // the old one cannot be reused. objConn.connect(function(err) { // The server is either down if(err) { // or restarting (takes a while sometimes). console.log('error when connecting to db:', err.code); setTimeout(handleDisconnect, 2000); // We introduce a delay before attempting to reconnect, }else{ console.log('Connected to db!'); } // to avoid a hot loop, and to allow our node script to }); // process asynchronous requests in the meantime. // If you're also serving http, display a 503 error. objConn.on('error', function(err) { if(err.code === 'PROTOCOL_CONNECTION_LOST') { // Connection to the MySQL server is usually handleDisconnect(); // lost due to either server restart, or a }else{ throw err; } }); } handleDisconnect(); megaLoop(); function megaLoop(){ objConn.query('SELECT u.`email` FROM `users` as u', function(err, rows) { console.log(err); console.log(rows); }); setTimeout(megaLoop, 100); } 

但是,当我在我的快速应用程序中使用function,我得到的错误。

 { [Error: Cannot enqueue Query after fatal error.] code: 'PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR', fatal: false } 

所以这个问题我有什么剂量错误的意思? 和方式剂量它在我的testing工作,而不是我的应用程序?

我相信这个问题是一个express-sql-session。 我现在遇到同样的问题。 我觉得有人在这个职位上: NodeJS在MAC上运行,并在centOS上部署时发生错误

看看这个: https : //github.com/felixge/node-mysql/issues/1166