node-mysql2

aws rds proxy throws timeout error from nodejs12.x

妖精的绣舞 提交于 2021-01-03 06:53:07
问题 I'm getting a connection timeout when I try to connect to mysql rds proxy. I'm followed this tutorial This is my code import mysql2 from 'mysql2'; import AWS from 'aws-sdk'; const getConnection = async () => { const signer = new AWS.RDS.Signer({ username: 'my-user-name', hostname: 'proxy-name.proxy-someid.us-east-1.rds.amazonaws.com', port: 3306 }); console.info('Connecting to MySQL proxy via IAM authentication'); const rdsSignerAuth = () => () => { console.info('CALL rdsSignerAuth'); return

aws rds proxy throws timeout error from nodejs12.x

心不动则不痛 提交于 2021-01-03 06:52:52
问题 I'm getting a connection timeout when I try to connect to mysql rds proxy. I'm followed this tutorial This is my code import mysql2 from 'mysql2'; import AWS from 'aws-sdk'; const getConnection = async () => { const signer = new AWS.RDS.Signer({ username: 'my-user-name', hostname: 'proxy-name.proxy-someid.us-east-1.rds.amazonaws.com', port: 3306 }); console.info('Connecting to MySQL proxy via IAM authentication'); const rdsSignerAuth = () => () => { console.info('CALL rdsSignerAuth'); return

Encoding not recognized in jest.js

一世执手 提交于 2020-05-14 18:12:05
问题 I have a problem testing a project using node-mysql2, react, sequelize and jest. This problem only occurs during testing. Encoding not recognized: 'cesu8' (searched as: 'cesu8') at Object.getCodec (project/node_modules/mysql2/node_modules/iconv-lite/lib/index.js:106:23) at Object.getDecoder (project/node_modules/mysql2/node_modules/iconv-lite/lib/index.js:122:23) at Object.<anonymous>.exports.decode (project/node_modules/mysql2/lib/parsers/string.js:9:23) at Packet.Object.<anonymous>.Packet

MySQL NodeJs - Proper way to get rows.each to work

拥有回忆 提交于 2019-12-13 03:25:37
问题 When I look for simple examples, everybody's style seems quite different. I'm tried 2 different styles, and got 2 different issues. In the code below, I have identified the source of the code and the error it gets in comments. I comment out or uncomment out each section and run separately, but each one has it's own errors. The "console.log(rows); " statement is showing the data, so the query itself is running and working. // get the client const mysql = require('mysql2'); const dashline = '--