//lond 封装了mysql操作 git地址https://github.com/lonfaliang/lond
var lond = require("lond")
var options = {
DATABASE: 'URQuantDB',
USERNAME: 'root',
PASSWORD: 'Root!!2018',
PORT: '3306',
HOST: '192.168.0.5',
connectionLimit: 30,
multipleStatements: true
}
lond.startMysql(options) //初始化Mysql模块 并得到mysql链接实例
lond.mysql.event.on("ready", async (data) => {//成功触发事件
let uer = await lond.mysql.query("select * from test")
if (uer.error) {
console.log(uer.error)
} else {
console.log(uer.result)
}
})
lond.mysql.event.on("error", async (err) => {//
console.error(err)
})