gpt4 book ai didi

mysql - PROTOCOL_SEQUENCE_TIMEOUT

转载 作者:行者123 更新时间:2023-12-03 21:31:16 28 4
gpt4 key购买 nike

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

{ 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 函数:
module.exports = mysql.createPool({
connectionLimit: 100,
host: 'localhost',
port: 8080,
user: 'me',
password: ''});

我在不同的端口上尝试使用和不使用密码。
我发现了一些关于 node 4.2 版本的问题,但我使用的是 7.4.0

最佳答案

尝试这个。

{
"host": "",
"database": "",
"user": "",
"password": "",
"port": 3306,
"connectionLimit": 100,
"queueLimit": 100,
"acquireTimeout": 1000000,
"connectTimeout": 30000,
"debug": false
},

关于mysql - PROTOCOL_SEQUENCE_TIMEOUT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41958596/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com