简体   繁体   English

错误:Node.js v6.9.1 和 MySQL 中的握手不活动超时

[英]Error: Handshake inactivity timeout in Node.js v6.9.1 and MySQL

I'm using 'mysql' and 'express-myconnection, when I'm running in localhost and some internet connections using AWS server its working perfectly.Yet when I'm at some of other internet connections with AWS setup its give out the error,Yet those connections have some decent internet speeds.我正在使用 'mysql' 和 'express-myconnection,当我在本地主机中运行并且一些使用 AWS 服务器的互联网连接时,它运行良好。但是,当我使用 AWS 设置进行其他一些互联网连接时,它会给出错误,然而这些连接有一些不错的互联网速度。

I'm using node ver.我正在使用节点版本。 6.9.1. 6.9.1.

I read these Issues were in older versions, I do need to know if anything can be done to fix it by development side without changing server it-self.我在旧版本中阅读了这些问题,我确实需要知道开发方面是否可以采取任何措施来修复它,而无需自行更改服务器。

'use strict';

var mysql      = require('mysql');
var connector  = require('express-myconnection');
var dotenv     = require('dotenv').config();

var connectionOptions = {
  host    : process.env.DB_HOST,
  database: process.env.DB_NAME,
  user    : process.env.DB_USER,
  password: process.env.DB_PASS,
  port    : process.env.DB_PORT,
};
var connection = connector(mysql, connectionOptions, 'pool'); 

module.exports = connection;

看起来mySql超时发生是因为我的互联网连接需要更长的时间来连接服务器,所以基本上它是路由器的DNS设置问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:Node.js MYSQL 模块中的握手不活动超时 - Error: Handshake inactivity timeout in Node.js MYSQL module 错误:握手不活动超时(MySQL + Node.js) - Error: Handshake inactivity timeout (MySQL + Node.js) 连接节点v5.10.1时握手不活动超时错误。 到aws mysql RDS - Handshake inactivity timeout error when connecting node v5.10.1. to aws mysql RDS Node.js AWS Lambda 使用 mysql 连接到 RDS - 错误:握手不活动超时 - Node js AWS Lambda using mysql connecting to RDS - Error: Handshake inactivity timeout 帆 js 错误:握手不活动超时 - sails js Error: Handshake inactivity timeout 握手不活动超时 - mysql 使用 sqltools - Handshake inactivity timeout - mysql using sqltools Node.js MySQL如何处理超时和握手不活动超时 - Nodejs mysql how to handle timeout and Handshake inactivity timeout 从ec2中的sails到rds中的MySQL的连接给出握手不活动超时错误 - Connection from sails in ec2 to MySQL in rds giving handshake inactivity timeout error 使用 TypeOrm 和 AWS RDS Aurora MySQL 实例的“握手不活动超时” - 'Handshake inactivity timeout' using TypeOrm and AWS RDS Aurora MySQL instance 握手不活动超时:nodejs 6.10.0 mysql pool.queryAsync - Handshake inactivity timeout: nodejs 6.10.0 mysql pool.queryAsync
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM