首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PROTOCOL_SEQUENCE_TIMEOUT

PROTOCOL_SEQUENCE_TIMEOUT
EN

Stack Overflow用户
提问于 2017-01-31 21:16:11
回答 1查看 1.8K关注 0票数 4

我在c9环境下完成了我的项目,现在我正尝试在本地服务器上使用它。我的数据库运行在个人本地服务器上,看起来像8080上的mamp。我的网络服务器8888。问题是,当我尝试使用mysql.createPool函数时,我有一个超时,并出现以下错误:

代码语言:javascript
复制
{ Error: Handshake inactivity timeout
at Handshake.<anonymous> (/Users/me/http/MyWebSite/matcha/node_modules/mysql/lib/protocol/Protocol.js:160:17)
at emitNone (events.js:86:13)
at Handshake.emit (events.js:185:7)
at Handshake._onTimeout (/Users/me/http/MyWebSite/matcha/node_modules/mysql/lib/protocol/sequences/Sequence.js:127:8)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)
--------------------
at Protocol._enqueue (/Users/me/http/MyWebSite/matcha/node_modules/mysql/lib/protocol/Protocol.js:141:48)
at Protocol.handshake (/Users/me/http/MyWebSite/matcha/node_modules/mysql/lib/protocol/Protocol.js:52:41)
at PoolConnection.connect (/Users/me/http/MyWebSite/matcha/node_modules/mysql/lib/Connection.js:130:18)
at Pool.getConnection (/Users/me/http/MyWebSite/matcha/node_modules/mysql/lib/Pool.js:48:16)
at /Users/me/http/MyWebSite/matcha/routes/users.js:96:14
at Layer.handle [as handle_request] (/Users/me/http/MyWebSite/matcha/node_modules/express/lib/router/layer.js:95:5)
at next (/Users/me/http/MyWebSite/matcha/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/Users/me/http/MyWebSite/matcha/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/Users/me/http/MyWebSite/matcha/node_modules/express/lib/router/layer.js:95:5)
at /Users/me/http/MyWebSite/matcha/node_modules/express/lib/router/index.js:277:22
code: 'PROTOCOL_SEQUENCE_TIMEOUT',
fatal: true,
timeout: 10000 }

下面是我的createPool函数:

代码语言:javascript
复制
module.exports = mysql.createPool({
connectionLimit: 100,
host: 'localhost',
port: 8080,
user: 'me',
password: ''});

我在不同的端口上分别使用和不使用密码进行了尝试。我发现了一些关于Node4.2版本的问题,但我使用的是7.4.0

EN

回答 1

Stack Overflow用户

发布于 2021-06-01 02:42:22

尝尝这个。

代码语言:javascript
复制
{
        "host": "",
        "database": "",
        "user": "",
        "password": "",
        "port": 3306,
        "connectionLimit": 100,
        "queueLimit": 100,
        "acquireTimeout": 1000000,
        "connectTimeout": 30000,
        "debug": false
    },
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41958596

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档