Advertisement
Guest User

Untitled

a guest
Sep 14th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. [Warning] Aborted connection 1237534 to db: 'dbname' user:
  2. 'dbuser' host: 'localhost' (Got an error reading communication
  3. packets)
  4.  
  5. var mysql = require('mysql');
  6.  
  7. var connection = mysql.createPool({
  8. connectionLimit : 1500, //important
  9. host : 'localhost',
  10. user : 'dbusername',
  11. password : 'dbpass',
  12. multipleStatements : true,
  13. port : someport,
  14. database : 'dbname',
  15. debug : false,
  16. connectTimeout:1000,
  17. });
  18.  
  19.  
  20. module.exports = {connection}
  21.  
  22. var {connection} = require('db-connect');
  23.  
  24. module.exports = function(app,connection){
  25. app.get('/something',(req,res) => {
  26. connection.query('somemysqlstuff',[value],(err,rows,fields) => {
  27.  
  28. });
  29. })
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement