Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Warning] Aborted connection 1237534 to db: 'dbname' user:
- 'dbuser' host: 'localhost' (Got an error reading communication
- packets)
- var mysql = require('mysql');
- var connection = mysql.createPool({
- connectionLimit : 1500, //important
- host : 'localhost',
- user : 'dbusername',
- password : 'dbpass',
- multipleStatements : true,
- port : someport,
- database : 'dbname',
- debug : false,
- connectTimeout:1000,
- });
- module.exports = {connection}
- var {connection} = require('db-connect');
- module.exports = function(app,connection){
- app.get('/something',(req,res) => {
- connection.query('somemysqlstuff',[value],(err,rows,fields) => {
- });
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement