egg-mysql连接不上

博客展示了ETIMEDOUT错误的相关信息,包括错误堆栈、错误编号、代码等。同时给出了解决方式,即设置连接超时时间,修改server\\node_modules\\mysql\\lib\\protocol\\sequences\\Sequence.js文件,将this._timeout参数调整为100000。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 at PoolConnection.Connection._handleConnectTimeout

at Object.onceWrapper (events.js:482:28)
    at Socket.emit (events.js:376:20)
    at Socket._onTimeout (net.js:483:8)
    at listOnTimeout (internal/timers.js:555:17)
    at processTimers (internal/timers.js:498:7)

errorno: "ETIMEDOUT"
code: "ETIMEDOUT"
syscall: "connect"
fatal: true
name: "ETIMEDOUTError"
pid: 6518

解决方式:

设置连接超时时间

修改文件下的:server\node_modules\mysql\lib\protocol\sequences\Sequence.js

修改文件中this._timeout  = 100000;【由原来的参数调整为该确定值】

exports.mysql = {
  default: {
    database: null,
    connectionLimit: 50000,
    connectTimeout:50000,
  },
  app: true,
  agent: false,

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值