Created
December 19, 2016 08:03
-
-
Save jsstoni/fa8cb409af3dbc9f53b7ac726ad4e201 to your computer and use it in GitHub Desktop.
pool mysql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mysql = require('mysql'); | |
var pool = mysql.createPool({ | |
connectionLimit : 10, | |
host : 'example.org', | |
user : 'bob', | |
password : 'secret', | |
database : 'my_db' | |
}); | |
pool.query('SELECT 1 + 1 AS solution', function(err, rows, fields) { | |
if (err) throw err; | |
console.log('The solution is: ', rows[0].solution); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment