SHARE
TWEET

Untitled

a guest Apr 15th, 2019 128 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const mysql = require('mysql');
  2.  
  3. const pool = mysql.createPool({
  4.     host: process.env.host,
  5.     user: process.env.user,
  6.     password: process.env.password,
  7.     database: process.env.database,
  8.     waitForConnections: true,
  9.     connectionLimit: 10,
  10.     queueLimit: 0
  11. });
  12.  
  13. if (!pool.getConnection(function(err) {console.error('Error connecting to database: ' + err.stack); return;})) {
  14.     return;
  15. }
  16.  
  17. console.info('Connected to database');
  18.  
  19. pool.query("SELECT * FROM societies");
  20.  
  21. module.exports = pool;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top