mysql - 连接失败 : Error: connect ETIMEDOUT

标签 mysql node.js express loopbackjs nodemon

我在 MySql 中使用 Loopback。我在运行时随机出现以下错误

nodemon .

node .
Web server listening at: http://0.0.0.0:3000
Browse your REST API at http://0.0.0.0:3000/explorer
Connection fails: Error: connect ETIMEDOUT
It will be retried for the next request.
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: connect ETIMEDOUT
    at PoolConnection.Connection._handleConnectTimeout
  1. 我该如何解决这个问题?在 Loopback 端配置或 MySQL 配置?注意:我正在为 MySQL 使用 MAMP。
  2. 需要很长时间才能成功启动而不出错。什么 我应该如何快速重启?

最佳答案

这似乎是 MySQL 和 Loopback 的一个已知问题,它会导致在 Loopback 首次启动时连接在重负载下超时:

https://github.com/strongloop/loopback-connector-mysql/issues/210

一些可能的解决方案:

关于mysql - 连接失败 : Error: connect ETIMEDOUT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39861042/

相关文章:

mysql - 动态数据透视表列 mysql

python - Django 。字段集有限的代理模型

express - Stripe CLI 触发随机事件而不是 payment_intent.succeeded

javascript - 在我的情况下如何向 Node 中的 Controller 发出请求?

html - Express 正确定义 post 路由方法

php - 搜索mysql字段的内容

php - 如何使用 Laravel 管理数据库表中的 'order' 列?

Node.js NTLM HTTP 身份验证,如何处理这 3 种类型

node.js - 单元测试快速应用程序

javascript - 如何将用 ES6 编写的模块发布到 NPM?