似乎有时与MYSQL的连接未成功关闭。我正在使用nodejs和node-mysql库。
client = mysql.createClient({ user: 'root', password: 'pass' });
client.query('USE db');
client.query( 'SELECT a FROM b ORDER BY c ASC', function selectCb(err, results, fields) {
client.end();
if (err) throw err;
....
});
答案 0 :(得分:0)
希望有所帮助!
client.end(function(err) {
// do what you want after the connection if closed :)
});
您也可以查看以下链接:https://github.com/felixge/node-mysql#pooling-connections`