如何包含Setup Connections和Parser?
var mysql = require('mysql');
var pool = mysql.createPool({
host : 'localhost',
user : 'medb',
password : '123458',
database : 'test',
connectionLimit: 100
});
下一步是什么?
答案 0 :(得分:1)
这是完成步骤以获取与池请求的mysql连接。
var mysql = require('mysql');
//Setup Connections and Parser
var pool = mysql.createPool({
host : 'localhost',
user : 'me',
password : '12345',
database : 'A2014',
connectionLimit: 100
});
pool.getConnection(function(err, connection) {
connection.query( 'select count(9) from mytbl;', function(err, rows) {
connection.release();
});
pool.end();
});