时间:2021-07-01 10:21:17 帮助过:7人阅读
var connection=mysql.createConnection({
"host":"localhost", "port":3306, "user":"root", "password":"wjb1234", "database":"test"
});
connection.connect();
console.log(“conned…“);
var select =“select * from test “;
connection.query(select,function(err,rows){
if(err) console.log(err.message); for( var i in rows){ console.log(rows[i]); }
});
connection.end();