完美

[学习|工作|博客|交流平台|完美起航]
 问题描述
时间:[ 2017-07-15 22:18:33 ]作者:[ zyw327 ]

nodejs使用mysql库的连接池连接经常出现连接数不够的问题,这个应该怎么解决。

{ Error: ER_CON_COUNT_ERROR: Too many connections
    at Handshake.Sequence._packetToError (/home/dev/waitting/node_modules/mysql/lib/protocol/sequences/Sequence.js:52:14)
    at Handshake.ErrorPacket (/home/dev/waitting/node_modules/mysql/lib/protocol/sequences/Handshake.js:103:18)
    at Protocol._parsePacket (/home/dev/waitting/node_modules/mysql/lib/protocol/Protocol.js:280:23)
    at Parser.write (/home/dev/waitting/node_modules/mysql/lib/protocol/Parser.js:75:12)
    at Protocol.write (/home/dev/waitting/node_modules/mysql/lib/protocol/Protocol.js:39:16)
    at Socket.<anonymous> (/home/dev/waitting/node_modules/mysql/lib/Connection.js:103:28)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    --------------------
    at Protocol._enqueue (/home/dev/waitting/node_modules/mysql/lib/protocol/Protocol.js:141:48)
    at Protocol.handshake (/home/dev/waitting/node_modules/mysql/lib/protocol/Protocol.js:52:41)
    at Connection.connect (/home/dev/waitting/node_modules/mysql/lib/Connection.js:130:18)
    at Connection._implyConnect (/home/dev/waitting/node_modules/mysql/lib/Connection.js:461:10)
    at Connection.query (/home/dev/waitting/node_modules/mysql/lib/Connection.js:206:8)
    at Promise (/home/dev/waitting/library/zyw/select.js:63:21)
    at Mysql.query (/home/dev/waitting/library/zyw/select.js:62:16)
    at Promise (/home/dev/waitting/library/zyw/select.js:256:18)
    at Mysql.featchAll (/home/dev/waitting/library/zyw/select.js:255:16)
    at Promise (/home/dev/waitting/app/model/table.js:53:20)
  code: 'ER_CON_COUNT_ERROR',
  errno: 1040,
  sqlState: undefined,
  fatal: true }


 相关评论