node mysql timeout_Error: Handshake inactivity timeout in Node.js MYSQL module
问题
I'm using node-mysql and most of the queries. Working. some queries not working.
I tried every version of Node (from 0.5...) until (5.6.0), I also tried (4.0) and (4.1), Nothing helps.
I tried to change maually, and didn't work. I tried to change the sequence file to: this._idleTimeout = -1; and didn't help.
I read the issues and GitHub, and nothing helped.
I can try to fix it by myself, but I need more information. Where is the timeout, why? when? what is this type of message? Where is the timeout came from?
MYSQL_ERROR { [Error: Handshake inactivity timeout]
code: 'PROTOCOL_SEQUENCE_TIMEOUT', fatal: true,
timeout: 10000 }
回答1:
Ok, the timeout comes from the Protocol.js file line:162. If you checkout node-mysql you'll see that it is a variable "timeout" for queries. If you set the timeout to something a lot higher than 10000, the default, then the error should go away. An example is
pool = require('mysql').createPool({
connectionLimit : 1000,
connectTimeout : 60 * 60 * 1000,
acquireTimeout : 60 * 60 * 1000,
timeout : 60 * 60 * 1000,
host : process.env.DB_HOST,
user : process.env.DB_USERNAME,
password : process.env.DB_PASSWORD,
database : process.env.DB_DATABASE
});
You can also edit the timeout in the Sequence.js file (node_modules/mysql/lib/protocol/sequence/Sequence.js)
this._timeout = 100000;
回答2:
If you are using Amazon's services, I was able to resolve this by changing the allowed IP Addresses in the security settings or by changing the open connections ports.
回答3:
For those deploying on AWS and experiencing this error, you'll need to make a change to the security group of your database/cluster and add an inbound rule where the source is the security group of your instance/s.
The inbound rule should look as follows:
Type: MySQL/Aurora
Protocol: TCP (default)
Port: 3306 (default)
Source:
Description:
回答4:
for those deploying on aws and heroku! enter in rds db instance settigns and change the inboud rule --> source: any..
Heroku dont provide a ip specific, remember!
来源:https://stackoverflow.com/questions/35553432/error-handshake-inactivity-timeout-in-node-js-mysql-module
node mysql timeout_Error: Handshake inactivity timeout in Node.js MYSQL module相关推荐
- 关于node链接数据库Handshake inactivity timeout
关于node项目在外部访问mysql数据库的请求握手超时接口返回 { msg:"Handshake inactivity timeout", state:false } 解决办法: ...
- Postman使用xmysql连接数据库及Handshake inactivity timeout、PROTOCOL SEQUENCE TIMEOUT问题解决
参考:https://blog.csdn.net/whcmyx/article/details/89890625 1.下载node.js并安装. 安装步骤:http://www.runoob.com/ ...
- LoopBack 出现Handshake inactivity timeout问题
为了方便学习,临时方案,改为本地数据库
- Ubuntu 16.04 下部署Node.js+MySQL微信小程序商城
本文档为微信小程序商城NideShop服务端api的安装部署教程 服务端api : https://github.com/tumobi/nideshop 微信小程序端 : https://github ...
- mysql事件循环执行,Node.js MySQL连接,查询顺序和事件循环
Let's see this example conn.query('SET @v = 1;', (err) => { conn.query('SELECT @v;', (err, res) = ...
- node.js+mysql实现分库分表存查数据:
node.js+mysql实现分库分表: 1.分库分表使用场景: 互联网项目中常用到的关系型数据库,如MySQL,随着用户和业务的增长,传统的单库单表模式难以满足大量的业务数据存储以及查询,单库单表中 ...
- node mysql商城开发_NideShop:基于Node.js+MySQL开发的微信小程序商城开源啦
NideShop:基于Node.js+MySQL开发的微信小程序商城开源啦 发布时间:2020-04-14 04:23:37 来源:51CTO 阅读:2894 作者:ch10mmt 高仿网易严选的微信 ...
- vue mysql 电商_mei-shopone: nuxt(vue)+node(egg.js)+mysql晒点风格极简商城,电商系统。适合入门全栈开发,槑先森工作室。...
mei-shopone 前言 此项目是基于nuxt+egg+mysql开发的在线商城系统全栈模板,目前前端部分已适配移动端.面向开发人员友好,快速,轻巧,干净,并包含W3有效源代码.后台管理系统基于v ...
- 【前端Vue+后端Node.js+MySql】部署到服务器
[前端Vue+后端Node.js+MySql]部署到服务器 文章目录 [前端Vue+后端Node.js+MySql]部署到服务器 1.买服务器 2.服务器操作 2.1.修改服务器密码,xshell登录 ...
最新文章
- PyTorch 进行 Neural-Transfer
- Spring中@Import注解的作用和使用
- 两个service事务统一_拜托,别再让我优化大事务了,我的头都裂了
- Nodejs基础中间件Connect
- 想要导航提示页最新安卓区_最新微信小程序授权的详细处理思路(一)
- Java 8 Streams API作为友好的ForkJoinPool外观
- 树莓派使用STEP1:装系统
- pythonplot绘图xrd_一种简化的截面动量组合测试[PythonMATLAB]
- 漫天飞舞的蒲公英你是我的幸福吗
- grub的概念,简单描述一下
- 跨Rollup转账应用HopProtocol将于4月份上线主网
- MY-SQL常用命令
- Jmeter入门1 官网下载及安装
- 1~3年产品经理经典面试题
- 论文写作学习心得体会
- python处理csv文件计算均值_读取CSV文件,计算平均值并打印所述平均值
- [7 kyu] Exes and Ohs
- 程序员大阳--所有教程、项目、源码导航
- windchill安全标签客制化
- 新版飞信取消手机号捆绑 分析称移动意在圈地
热门文章
- 在c语言程序中main函数的位置,在C语言程序中,main函数的位置_________。
- VBA 创建和使用加载项
- 燕东微在科创板上市:市值263亿元,北京电控、亦庄国投等为股东
- Unity在Canvas上画线(Draw Line)实现
- 五分钟玩转Andriod开发环境配置
- @aspect注解无法添加
- dp在约会上是什么意思_饭圈用语dp是什么梗 饭圈用语dp是什么意思
- c语言 不用锁存器 数码管倒计时,倒计时器课程设计.doc
- 工业面阵相机及镜头的选择(笔记)
- matlab求解一阶微分方程组