错误:环回中的握手不活动超时

时间:2019-07-28 00:45:30

标签: mysql node.js loopback

我正在后端创建带有回送功能的节点js应用程序。我正在使用mysql存储数据。当我运行服务器时,它可以正常运行,但只能运行3到4秒钟。之后,我在cmd提示符下出现以下错误。我想继续运行util,我想关闭它

Error: Handshake inactivity timeout
    at Handshake.<anonymous> (C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\mysql\lib\protocol\Protocol.js:160:17)
    at Handshake.emit (events.js:203:13)
    at Handshake._onTimeout (C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\mysql\lib\protocol\sequences\Sequence.js:124:8)
    at Timer._onTimeout (C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\mysql\lib\protocol\Timer.js:32:23)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7)
    --------------------
    at Protocol._enqueue (C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\mysql\lib\protocol\Protocol.js:144:48)
    at Protocol.handshake (C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\mysql\lib\protocol\Protocol.js:51:23)
    at PoolConnection.connect (C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\mysql\lib\Connection.js:119:18)
    at Pool.getConnection (C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\mysql\lib\Pool.js:48:16)
    at MySQL.connect (C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\loopback-connector-mysql\lib\mysql.js:90:17)
    at Object.initializeDataSource [as initialize] (C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\loopback-connector-mysql\lib\mysql.js:44:28)
    at DataSource.setup (C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\loopback-datasource-juggler\lib\datasource.js:493:19)
    at new DataSource (C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\loopback-datasource-juggler\lib\datasource.js:138:8)
    at Registry.createDataSource (C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\loopback\lib\registry.js:364:12)
    at dataSourcesFromConfig (C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\loopback\lib\application.js:570:19)
    at Function.app.dataSource (C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\loopback\lib\application.js:269:14)
    at C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\loopback-boot\lib\executor.js:191:9
    at C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\loopback-boot\lib\executor.js:282:5
    at Array.forEach (<anonymous>)
    at forEachKeyedObject (C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\loopback-boot\lib\executor.js:281:20)
    at setupDataSources (C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\loopback-boot\lib\executor.js:181:3)
Emitted 'error' event at:
    at DataSource.postInit (C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\loopback-datasource-juggler\lib\datasource.js:480:16)
    at C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\loopback-connector-mysql\lib\mysql.js:102:19
    at Handshake.onConnect (C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\mysql\lib\Pool.js:58:9)
    at Handshake.<anonymous> (C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\mysql\lib\Connection.js:525:10)
    at Handshake._callback (C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\mysql\lib\Connection.js:491:16)
    at Handshake.Sequence.end (C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\mysql\lib\protocol\sequences\Sequence.js:83:24)
    at C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\mysql\lib\protocol\Protocol.js:404:18
    at Array.forEach (<anonymous>)
    at C:\Users\Khundokar Nirjor\Desktop\Loopback\cart\node_modules\mysql\lib\protocol\Protocol.js:403:13
    at processTicksAndRejections (internal/process/task_queues.js:75:11) {
  code: 'PROTOCOL_SEQUENCE_TIMEOUT',
  fatal: true,
  timeout: 10000
}

这是代码datasource.json

{
  "shoppingdatabase": {
    "host": "localhost",
    "port": 8081,
    "url": "",
    "database": "shoppingdatabase",
    "password": "",
    "name": "shoppingdatabase",
    "user": "root",
    "connector": "mysql",
    "connectionTimeout": 1000000
  }
}

0 个答案:

没有答案