码迷,mamicode.com
首页 >  
搜索关键字:nodejs使用连接池连接数据库    ( 1个结果
Nodejs使用连接池连接数据库
创建OptPool.jsvarmysql=require(‘mysql‘);functionOptPool(){ this.flag=true; this.pool=mysql.createPool({ host:‘localhost‘, user:‘root‘, password:‘‘, database:‘mtc‘, port:‘3306‘ }); this.getPool=function(){ if(this.flag){ this.pool.on(‘connection‘,fun..
分类:数据库   时间:2017-01-13 16:13:00    阅读次数:340
1条  
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!