我在这里遗漏了什么吗?这应该可以正常工作,但我发现Node run loop保持活动状态。
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();
答案 0 :(得分:2)
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();
});