Node.js错误";现在无法切换到旧模式。”;使用MySQL NPM

Node.js错误";现在无法切换到旧模式。”;使用MySQL NPM,mysql,node.js,Mysql,Node.js,Node.js在通过发出查询时抛出以下错误 引发此错误的示例代码: query = mysqlCLI.query( 'SELECT * FROM foo WHERE bar = 1' ); results = []; mysqlCLI.resume(); query .on( 'error', function ( err ) { console.log( 'Bad Things: ', err ); }) .on( 'result', function ( r

Node.js在通过发出查询时抛出以下错误

引发此错误的示例代码:

query  = mysqlCLI.query( 'SELECT * FROM foo WHERE bar = 1' );
results = [];

mysqlCLI.resume();

query

  .on( 'error', function ( err ) {

    console.log( 'Bad Things: ', err );

  })

  .on( 'result', function ( row ) {

      results.push( row );

  })

  .on( 'end', function (){

    mysqlCLI.pause();

    dataHandler( results );

  });

这需要进行大量的故障排除,但最终的修复方法是同时删除
mysqlCLI.pause()
mysqlCLI.resume()。这个问题的奇怪之处在于,该代码在Windows Server 2003上执行得很好,但一旦我通过Git进行克隆,它就在CentOS 5.9(RHEL)下崩溃了

query  = mysqlCLI.query( 'SELECT * FROM foo WHERE bar = 1' );
results = [];

mysqlCLI.resume();

query

  .on( 'error', function ( err ) {

    console.log( 'Bad Things: ', err );

  })

  .on( 'result', function ( row ) {

      results.push( row );

  })

  .on( 'end', function (){

    mysqlCLI.pause();

    dataHandler( results );

  });