Advertisement
Guest User

ConexionDB

a guest
Jul 9th, 2018
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var mysql = require('mysql');
  2. port = process.env.PORT || 4205;
  3.  
  4. if (port === 4205) {
  5.     var connection = mysql.createConnection({
  6.         host: 'localhost',
  7.         port: 3306,
  8.         user: 'root',
  9.         password: '',
  10.         database: '9a',
  11.         insecureAuth: true
  12.     });
  13. } else {console.log("No hay conexión");}
  14.  
  15. connection.connect();
  16.  
  17. module.exports = connection;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement